Add simple system tray

This commit is contained in:
vslg 2020-09-03 20:09:29 -03:00
parent acb1367f11
commit bbcdcde53f
2 changed files with 16 additions and 0 deletions

View File

@ -2,6 +2,7 @@
import QtQuick 2.12 import QtQuick 2.12
import QtQuick.Controls 2.12 import QtQuick.Controls 2.12
import Qt.labs.platform 1.1
import "Base" import "Base"
import "PythonBridge" import "PythonBridge"
@ -100,4 +101,19 @@ ApplicationWindow {
Behavior on scale { HNumberAnimation { overshoot: 3; factor: 1.2 } } Behavior on scale { HNumberAnimation { overshoot: 3; factor: 1.2 } }
} }
SystemTrayIcon {
property string iconPack: theme ? theme.icons.preferredPack : "thin"
visible: true
tooltip: qsTr("Mirage")
icon.source: `../icons/${iconPack}/tray-icon.png`
menu: Menu {
MenuItem {
text: qsTr("Quit")
onTriggered: window.close()
}
}
}
} }

Binary file not shown.

After

Width:  |  Height:  |  Size: 2.0 KiB