From c5d184cbe38d8024c6354952d3103423d51638ec Mon Sep 17 00:00:00 2001 From: Niels Weber Date: Mon, 28 Apr 2014 09:39:16 +0200 Subject: Selecting something now closes menu On a closed menu, the text is now hidden. Task-number: QTBUG-38121 Change-Id: I305fd4f24768115ed21495857cce672d8cbd2135 Reviewed-by: Petref Saraci Reviewed-by: Thomas Hartmann --- .../video/qmlvideofx/qml/qmlvideofx/FileOpen.qml | 76 ++++++++++++++-------- 1 file changed, 48 insertions(+), 28 deletions(-) diff --git a/examples/multimedia/video/qmlvideofx/qml/qmlvideofx/FileOpen.qml b/examples/multimedia/video/qmlvideofx/qml/qmlvideofx/FileOpen.qml index b0542cb80..a4de2cbb9 100644 --- a/examples/multimedia/video/qmlvideofx/qml/qmlvideofx/FileOpen.qml +++ b/examples/multimedia/video/qmlvideofx/qml/qmlvideofx/FileOpen.qml @@ -49,28 +49,40 @@ Rectangle { signal openVideo signal close - Column { - anchors.fill: parent - spacing: 10 - Rectangle { - height: itemHeight - width: itemHeight - color: "transparent" - anchors.right: parent.right - Image { - id: menu - source: "qrc:///images/icon_Menu.png" - anchors { - right: parent.right - top: parent.top - margins: scaledMargin - } - } - MouseArea { - anchors.fill: parent - onClicked: fileOpen.state == "expanded" ? fileOpen.state = "collapsed" : fileOpen.state = "expanded" + + Rectangle { + id: menuField + height: itemHeight + width: itemHeight + color: "transparent" + anchors.right: parent.right + Image { + id: menu + source: "qrc:///images/icon_Menu.png" + anchors { + right: parent.right + top: parent.top + margins: scaledMargin } } + MouseArea { + anchors.fill: parent + onClicked: fileOpen.state == "expanded" ? fileOpen.state = "collapsed" : fileOpen.state = "expanded" + } + } + + Column { + anchors { + top: menuField.bottom + right: parent.right + left: parent.left + bottom: parent.bottom + topMargin: 10 + } + + spacing: 10 + visible: fileOpen.state == "expanded" + Rectangle { width: 0.9 * parent.width height: 1 @@ -81,8 +93,10 @@ Rectangle { text: "Start camera" height: itemHeight width: parent.width - onClicked: root.openCamera() - active: fileOpen.state == "expanded" + onClicked: { + fileOpen.state = "collapsed" + root.openCamera() + } } Rectangle { width: 0.9 * parent.width @@ -94,8 +108,10 @@ Rectangle { text: "Open image" height: itemHeight width: parent.width - onClicked: root.openImage() - active: fileOpen.state == "expanded" + onClicked: { + fileOpen.state = "collapsed" + root.openImage() + } } Rectangle { width: 0.9 * parent.width @@ -107,8 +123,10 @@ Rectangle { text: "Open video" height: itemHeight width: parent.width - onClicked: root.openVideo() - active: fileOpen.state == "expanded" + onClicked: { + fileOpen.state = "collapsed" + root.openVideo() + } } Rectangle { width: 0.9 * parent.width @@ -120,8 +138,10 @@ Rectangle { text: "Reset" height: itemHeight width: parent.width - onClicked: root.close() - active: fileOpen.state == "expanded" + onClicked: { + fileOpen.state = "collapsed" + root.close() + } } Rectangle { width: 0.9 * parent.width -- cgit v1.2.3