This commit is contained in:
Hannes
2026-02-17 15:30:20 +01:00
parent 16b90f2987
commit d461bc1770
+14 -1
View File
@@ -12,6 +12,7 @@ Row { // Workspace Row
model: SystemTray.items model: SystemTray.items
Rectangle { //trayItem Rectangle { //trayItem
id: trayItem
width: bar.height width: bar.height
height: bar.height height: bar.height
radius: 4 radius: 4
@@ -35,17 +36,29 @@ Row { // Workspace Row
onClicked: (mouse) => { onClicked: (mouse) => {
switch (mouse.button) { switch (mouse.button) {
case Qt.LeftButton: case Qt.LeftButton:
if (!modelData.onlyMenu) {
modelData.activate() modelData.activate()
console.log('Activcate function of ', modelData.title)
}
break break
case Qt.MiddleButton: case Qt.MiddleButton:
modelData.secondaryActivate?.() modelData.secondaryActivate?.()
console.log('Activcate secondary function of ', modelData.title)
break break
case Qt.RightButton: case Qt.RightButton:
modelData.activate() if (modelData.hasMenu) {
console.log('Activcate menu of ', modelData.title)
menuAnchor.open(modelData.menu)
}
break break
} }
} }
QsMenuAnchor {
id: menuAnchor
menu: modelData.menu
anchor.window: trayItem
}
Rectangle { Rectangle {
anchors.fill: parent anchors.fill: parent