fix(@desktop): missing context menu on SystemTrayIcon
This commit is contained in:
parent
f73fbe3204
commit
b3528bd717
|
@ -47,7 +47,7 @@ proc mainProc() =
|
||||||
enableHDPI()
|
enableHDPI()
|
||||||
initializeOpenGL()
|
initializeOpenGL()
|
||||||
|
|
||||||
let app = newQApplication("Status Desktop")
|
let app = newQGuiApplication()
|
||||||
let resources =
|
let resources =
|
||||||
if defined(windows) and defined(production):
|
if defined(windows) and defined(production):
|
||||||
"/../resources/resources.rcc"
|
"/../resources/resources.rcc"
|
||||||
|
|
17
ui/main.qml
17
ui/main.qml
|
@ -143,14 +143,20 @@ StatusWindow {
|
||||||
return "shared/img/status-logo-dev-circle.svg"
|
return "shared/img/status-logo-dev-circle.svg"
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function openStatusWindow() {
|
||||||
|
applicationWindow.show()
|
||||||
|
applicationWindow.raise()
|
||||||
|
applicationWindow.requestActivate()
|
||||||
|
}
|
||||||
|
|
||||||
menu: Menu {
|
menu: Menu {
|
||||||
MenuItem {
|
MenuItem {
|
||||||
visible: !applicationWindow.visible
|
visible: !applicationWindow.visible
|
||||||
//% "Open Status"
|
//% "Open Status"
|
||||||
text: qsTrId("open-status")
|
text: qsTrId("open-status")
|
||||||
onTriggered: {
|
onTriggered: {
|
||||||
applicationWindow.visible = true;
|
systemTray.openStatusWindow()
|
||||||
applicationWindow.requestActivate();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -166,12 +172,9 @@ StatusWindow {
|
||||||
}
|
}
|
||||||
|
|
||||||
onActivated: {
|
onActivated: {
|
||||||
if (reason === SystemTrayIcon.Context) {
|
if (reason !== SystemTrayIcon.Context) {
|
||||||
return
|
openStatusWindow()
|
||||||
}
|
}
|
||||||
applicationWindow.show()
|
|
||||||
applicationWindow.raise()
|
|
||||||
applicationWindow.requestActivate()
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1 +1 @@
|
||||||
Subproject commit eaa394d711f757b859030349aeaf41a10e1bad2b
|
Subproject commit 719af38d64d2f61a4e3c858c77a747586fdd58af
|
|
@ -1 +1 @@
|
||||||
Subproject commit 65fa68c244fa52037de652520755430ec65c77df
|
Subproject commit 6a5f0ef32ef63b11258866f6208ccfbd43245fd3
|
Loading…
Reference in New Issue