Improve system tray icon click behavior

- Middle click now closes Mirage
- A normal click now toggle window visibility
This commit is contained in:
vslg 2020-09-05 14:47:50 -03:00
parent a543c79c02
commit c41ed5d77d

View File

@ -30,10 +30,12 @@ SystemTrayIcon {
tooltip: Qt.application.displayName
icon.source: `../../icons/${iconPack}/tray-icon.png`
onActivated:
if (reason !== SystemTrayIcon.Context)
window.drawAttention()
onActivated: {
if (reason === SystemTrayIcon.MiddleClick)
Qt.quit()
else if (reason !== SystemTrayIcon.Context)
window.visible ? window.hide() : window.drawAttention()
}
menu: Menu {
MenuItem {