From bbcdcde53f9ffcfb691b3241ba6305beac1515ee Mon Sep 17 00:00:00 2001 From: vslg Date: Thu, 3 Sep 2020 20:09:29 -0300 Subject: [PATCH] Add simple system tray --- src/gui/Window.qml | 16 ++++++++++++++++ src/icons/thin/tray-icon.png | Bin 0 -> 2032 bytes 2 files changed, 16 insertions(+) create mode 100644 src/icons/thin/tray-icon.png diff --git a/src/gui/Window.qml b/src/gui/Window.qml index e19e165f..542badc7 100644 --- a/src/gui/Window.qml +++ b/src/gui/Window.qml @@ -2,6 +2,7 @@ import QtQuick 2.12 import QtQuick.Controls 2.12 +import Qt.labs.platform 1.1 import "Base" import "PythonBridge" @@ -100,4 +101,19 @@ ApplicationWindow { 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() + } + } + } } diff --git a/src/icons/thin/tray-icon.png b/src/icons/thin/tray-icon.png new file mode 100644 index 0000000000000000000000000000000000000000..ffa58eec5b14e1adccb535b50e97579b90eba8c2 GIT binary patch literal 2032 zcmcIli&qn87XM~;goL1h&|QkVWAu);lvj2g*XXl)md++Z)esg~J zJ2Q3fu@hH1t#$$ctW4S#p9TN|T?7yupvgSYnGX$Cx+Q5l0bUh^J+&|<^0#G_0w621 z-$-1}x2X{H5NzEkNH5732y+hP0ijSBRJgCGG&hHz7gTbf;N;?_)c`maC&h2xE|NZ< zQj}x~J#H;&%5z=RHJ^=tdXp6Tt|1k5b}n`nZ*)!f@Hpn{N(}hT{^Ek*uFsAQ$ES4o z7GQsgAdxyhm#x3JCpQN_vo|2gf3evoO&>S$(qQ<`IH|AP{WW7|vUgdg`EgBnUanB# z;CJwfJi}a76Wd^}LQXSKP)7uQRB-GBV1D$b!4HpoJ-O}IW4hYQ>qTLasl#(y>JId1 zjl8>CP&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