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 <petref.saraci@digia.com>
Reviewed-by: Thomas Hartmann <Thomas.Hartmann@digia.com>
This commit is contained in:
Niels Weber
2014-04-28 09:39:16 +02:00
committed by The Qt Project
parent 2939c9953a
commit c5d184cbe3

View 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