tray menu
This commit is contained in:
+19
-2
@@ -32,6 +32,7 @@ PopupWindow {
|
||||
grab.active = root.visible;
|
||||
}
|
||||
Rectangle {
|
||||
id: menuRect
|
||||
anchors.fill: parent
|
||||
color: "#90000000"
|
||||
radius: 8
|
||||
@@ -69,10 +70,22 @@ PopupWindow {
|
||||
propagateComposedEvents: true
|
||||
acceptedButtons: Qt.LeftButton
|
||||
onClicked: {
|
||||
menuItem.modelData.triggered();
|
||||
root.visible = false;
|
||||
if ( !menuItem.modelData.hasChildren ) {
|
||||
menuItem.modelData.triggered();
|
||||
root.visible = false;
|
||||
} else {
|
||||
subMenuComponent.createObject( null, {
|
||||
menu: menuItem.modelData,
|
||||
anchor: {
|
||||
item: menuItem,
|
||||
edges: Edges.Right
|
||||
},
|
||||
visible: true
|
||||
})
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Text {
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
anchors.left: parent.left
|
||||
@@ -84,4 +97,8 @@ PopupWindow {
|
||||
}
|
||||
}
|
||||
}
|
||||
Component {
|
||||
id: subMenuComponent
|
||||
SubMenu {}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user