diff options
-rw-r--r-- | changes/bug_2574_restore-from-minimized | 1 | ||||
-rw-r--r-- | src/leap/gui/mainwindow.py | 17 |
2 files changed, 14 insertions, 4 deletions
diff --git a/changes/bug_2574_restore-from-minimized b/changes/bug_2574_restore-from-minimized new file mode 100644 index 00000000..1a16f2a0 --- /dev/null +++ b/changes/bug_2574_restore-from-minimized @@ -0,0 +1 @@ + o Fix main client window not restoring after minimized into systray. Closes #2574 diff --git a/src/leap/gui/mainwindow.py b/src/leap/gui/mainwindow.py index 3e8a1c83..a8aa1b1c 100644 --- a/src/leap/gui/mainwindow.py +++ b/src/leap/gui/mainwindow.py @@ -420,12 +420,21 @@ class MainWindow(QtGui.QMainWindow): Toggles the window visibility """ + get_action = lambda visible: ( + self.tr("Show"), + self.tr("Hide"))[int(visible)] + + minimized = self.isMinimized() + if reason != QtGui.QSystemTrayIcon.Context: + # do show + if minimized: + self.showNormal() self.setVisible(not self.isVisible()) - action_visible_text = self.tr("Hide") - if not self.isVisible(): - action_visible_text = self.tr("Show") - self._action_visible.setText(action_visible_text) + + # set labels + visible = self.isVisible() + self._action_visible.setText(get_action(visible)) def _center_window(self): """ |