mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-11 06:47:01 +00:00
8216ea37f7
* feat(icon): show a red dot when we have unread notifications * feat(windows-icon): update windows icon to have a white border Fixes #14788 Fixes #14855 Adds a red dot on the tray icon if there is an unread message in an unmuted channel or in the activity center
52 lines
1.1 KiB
QML
52 lines
1.1 KiB
QML
import Qt.labs.platform 1.1
|
|
|
|
import utils 1.0
|
|
|
|
SystemTrayIcon {
|
|
id: root
|
|
|
|
property bool isProduction: true
|
|
property bool showRedDot: false
|
|
|
|
signal activateApp()
|
|
|
|
visible: true
|
|
|
|
|
|
icon.source: {
|
|
if (Qt.platform.os === Constants.windows) {
|
|
return root.showRedDot ? Style.svg("status-logo-white-windows-with-red-dot") : Style.svg("status-logo-white-windows")
|
|
}
|
|
return root.showRedDot ? Style.svg("status-logo-white-with-red-dot") : Style.svg("status-logo-white")
|
|
}
|
|
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()
|
|
}
|
|
}
|
|
} |