System tray icon: On windows if the calibre window is minimized, fix clicking on the system tray icon not restoring the window. Fixes #1387596 [windows systray-icon behaviour](https://bugs.launchpad.net/calibre/+bug/1387596)

This commit is contained in:
Kovid Goyal 2014-10-30 16:17:50 +05:30
parent b363d6b5d1
commit 5f0cc490e2

View File

@ -498,9 +498,14 @@ class Main(MainWindow, MainWindowMixin, DeviceMixin, EmailMixin, # {{{
def system_tray_icon_activated(self, r=False):
if r in (QSystemTrayIcon.Trigger, QSystemTrayIcon.MiddleClick, False):
if self.isVisible():
self.hide_windows()
if self.isMinimized():
self.showNormal()
else:
self.hide_windows()
else:
self.show_windows()
if self.isMinimized():
self.showNormal()
@property
def is_minimized_to_tray(self):