summaryrefslogtreecommitdiff
path: root/src
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 /src
parentb2d5983d83e35a0766c79134e47b71a4c82d9680 (diff)
fix restore from minimized. Closes #2574
Diffstat (limited to 'src')
-rw-r--r--src/leap/gui/mainwindow.py17
1 files changed, 13 insertions, 4 deletions
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):
"""