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 tooltip: Qt.application.displayName
icon.source: `../../icons/${iconPack}/tray-icon.png` icon.source: `../../icons/${iconPack}/tray-icon.png`
onActivated: onActivated: {
if (reason !== SystemTrayIcon.Context) if (reason === SystemTrayIcon.MiddleClick)
window.drawAttention() Qt.quit()
else if (reason !== SystemTrayIcon.Context)
window.visible ? window.hide() : window.drawAttention()
}
menu: Menu { menu: Menu {
MenuItem { MenuItem {