summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorkali <kali@leap.se>2013-05-23 22:47:18 +0900
committerkali <kali@leap.se>2013-05-23 22:47:18 +0900
commit9516f7e34cf265f87abb67e40b9fa76682012c84 (patch)
treecf3997411d43d65198d2979a4e6cb481164b7d25
parentb2d5983d83e35a0766c79134e47b71a4c82d9680 (diff)
fix restore from minimized. Closes #2574
-rw-r--r--changes/bug_2574_restore-from-minimized1
-rw-r--r--src/leap/gui/mainwindow.py17
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):
"""