2024-05-15 13:55:54 +00:00
|
|
|
import Qt.labs.platform 1.1
|
|
|
|
|
2024-10-15 19:26:12 +00:00
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
|
2024-05-15 13:55:54 +00:00
|
|
|
import utils 1.0
|
|
|
|
|
|
|
|
SystemTrayIcon {
|
|
|
|
id: root
|
|
|
|
|
|
|
|
property bool isProduction: true
|
2024-07-12 13:41:27 +00:00
|
|
|
property bool showRedDot: false
|
2024-05-15 13:55:54 +00:00
|
|
|
|
|
|
|
signal activateApp()
|
|
|
|
|
|
|
|
visible: true
|
2024-07-12 13:41:27 +00:00
|
|
|
|
|
|
|
|
|
|
|
icon.source: {
|
|
|
|
if (Qt.platform.os === Constants.windows) {
|
2024-10-15 19:26:12 +00:00
|
|
|
return root.showRedDot ? Theme.svg("status-logo-white-windows-with-red-dot") : Theme.svg("status-logo-white-windows")
|
2024-07-12 13:41:27 +00:00
|
|
|
}
|
2024-10-15 19:26:12 +00:00
|
|
|
return root.showRedDot ? Theme.svg("status-logo-white-with-red-dot") : Theme.svg("status-logo-white")
|
2024-07-12 13:41:27 +00:00
|
|
|
}
|
2024-05-15 13:55:54 +00:00
|
|
|
icon.mask: Qt.platform.os !== Constants.windows
|
|
|
|
|
|
|
|
onMessageClicked: {
|
|
|
|
if (Qt.platform.os === Constants.windows) {
|
|
|
|
root.activateApp()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
menu: Menu {
|
|
|
|
MenuItem {
|
|
|
|
text: qsTr("Open Status")
|
|
|
|
onTriggered: {
|
|
|
|
root.activateApp()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
MenuSeparator {
|
|
|
|
}
|
|
|
|
|
|
|
|
MenuItem {
|
|
|
|
text: qsTr("Quit")
|
|
|
|
onTriggered: Qt.quit()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
onActivated: {
|
|
|
|
if (reason !== SystemTrayIcon.Context) {
|
|
|
|
root.activateApp()
|
|
|
|
}
|
|
|
|
}
|
2024-10-15 19:26:12 +00:00
|
|
|
}
|