Improve system tray icon click behavior
- Middle click now closes Mirage - A normal click now toggle window visibility
This commit is contained in:
parent
a543c79c02
commit
c41ed5d77d
|
@ -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 {
|
||||||
|
|
Loading…
Reference in New Issue
Block a user