From c41ed5d77d4e54c797d503fad3263729d3d54be1 Mon Sep 17 00:00:00 2001 From: vslg Date: Sat, 5 Sep 2020 14:47:50 -0300 Subject: [PATCH] Improve system tray icon click behavior - Middle click now closes Mirage - A normal click now toggle window visibility --- src/gui/Base/HTrayIcon.qml | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/src/gui/Base/HTrayIcon.qml b/src/gui/Base/HTrayIcon.qml index b7a2d249..d653a6d2 100644 --- a/src/gui/Base/HTrayIcon.qml +++ b/src/gui/Base/HTrayIcon.qml @@ -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 {