tray
This commit is contained in:
@@ -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:
|
||||||
modelData.activate()
|
if (!modelData.onlyMenu) {
|
||||||
|
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
|
||||||
|
|||||||
Reference in New Issue
Block a user