tray menu

This commit is contained in:
Zacharias-Brohn
2025-10-28 16:40:28 +01:00
parent 762bae37cb
commit 1b12ff6e7f
4 changed files with 140 additions and 2 deletions
+19 -2
View File
@@ -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 {}
}
}