tray
This commit is contained in:
@@ -12,6 +12,7 @@ Row { // Workspace Row
|
||||
model: SystemTray.items
|
||||
|
||||
Rectangle { //trayItem
|
||||
id: trayItem
|
||||
width: bar.height
|
||||
height: bar.height
|
||||
radius: 4
|
||||
@@ -35,17 +36,29 @@ Row { // Workspace Row
|
||||
onClicked: (mouse) => {
|
||||
switch (mouse.button) {
|
||||
case Qt.LeftButton:
|
||||
modelData.activate()
|
||||
if (!modelData.onlyMenu) {
|
||||
modelData.activate()
|
||||
console.log('Activcate function of ', modelData.title)
|
||||
}
|
||||
break
|
||||
case Qt.MiddleButton:
|
||||
modelData.secondaryActivate?.()
|
||||
console.log('Activcate secondary function of ', modelData.title)
|
||||
break
|
||||
case Qt.RightButton:
|
||||
modelData.activate()
|
||||
if (modelData.hasMenu) {
|
||||
console.log('Activcate menu of ', modelData.title)
|
||||
menuAnchor.open(modelData.menu)
|
||||
}
|
||||
break
|
||||
}
|
||||
}
|
||||
|
||||
QsMenuAnchor {
|
||||
id: menuAnchor
|
||||
menu: modelData.menu
|
||||
anchor.window: trayItem
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
anchors.fill: parent
|
||||
|
||||
Reference in New Issue
Block a user