Selecting something now closes menu
authorNiels Weber <niels.weber@digia.com>
Mon, 28 Apr 2014 07:39:16 +0000 (09:39 +0200)
committerThe Qt Project <gerrit-noreply@qt-project.org>
Wed, 30 Apr 2014 11:40:34 +0000 (13:40 +0200)
On a closed menu, the text is now hidden.

Task-number: QTBUG-38121
Change-Id: I305fd4f24768115ed21495857cce672d8cbd2135
Reviewed-by: Petref Saraci <petref.saraci@digia.com>
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
examples/multimedia/video/qmlvideofx/qml/qmlvideofx/FileOpen.qml

index b0542cb..a4de2cb 100644 (file)
@@ -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