fix(@desktop): missing context menu on SystemTrayIcon

This commit is contained in:
Andrei Smirnov 2021-07-19 15:14:10 +03:00 committed by Iuri Matias
parent f73fbe3204
commit b3528bd717
4 changed files with 13 additions and 10 deletions

View File

@ -47,7 +47,7 @@ proc mainProc() =
enableHDPI()
initializeOpenGL()
let app = newQApplication("Status Desktop")
let app = newQGuiApplication()
let resources =
if defined(windows) and defined(production):
"/../resources/resources.rcc"

View File

@ -143,14 +143,20 @@ StatusWindow {
return "shared/img/status-logo-dev-circle.svg"
}
}
function openStatusWindow() {
applicationWindow.show()
applicationWindow.raise()
applicationWindow.requestActivate()
}
menu: Menu {
MenuItem {
visible: !applicationWindow.visible
//% "Open Status"
text: qsTrId("open-status")
onTriggered: {
applicationWindow.visible = true;
applicationWindow.requestActivate();
systemTray.openStatusWindow()
}
}
@ -166,12 +172,9 @@ StatusWindow {
}
onActivated: {
if (reason === SystemTrayIcon.Context) {
return
if (reason !== SystemTrayIcon.Context) {
openStatusWindow()
}
applicationWindow.show()
applicationWindow.raise()
applicationWindow.requestActivate()
}
}

2
vendor/DOtherSide vendored

@ -1 +1 @@
Subproject commit eaa394d711f757b859030349aeaf41a10e1bad2b
Subproject commit 719af38d64d2f61a4e3c858c77a747586fdd58af

2
vendor/nimqml vendored

@ -1 +1 @@
Subproject commit 65fa68c244fa52037de652520755430ec65c77df
Subproject commit 6a5f0ef32ef63b11258866f6208ccfbd43245fd3