summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/zoomheight.py
diff options
context:
space:
mode:
authorCheryl Sabella <cheryl.sabella@gmail.com>2018-12-22 06:25:45 (GMT)
committerMiss Islington (bot) <31488909+miss-islington@users.noreply.github.com>2018-12-22 06:25:45 (GMT)
commitc1b4b0f6160e1919394586f44b12538505fed300 (patch)
tree847a401a62c7dae4bb6a28eb60f66bf5a02933f1 /Lib/idlelib/zoomheight.py
parent87667c54c6650751c5d7bf7b9e465c8c4af45f71 (diff)
downloadcpython-c1b4b0f6160e1919394586f44b12538505fed300.zip
cpython-c1b4b0f6160e1919394586f44b12538505fed300.tar.gz
cpython-c1b4b0f6160e1919394586f44b12538505fed300.tar.bz2
bpo-22703: IDLE: Improve Code Context and Zoom Height menu labels (GH-11214)
The Code Context menu label now toggles between Show/Hide Code Context. The Zoom Height menu now toggles between Zoom/Restore Height. Zoom Height has moved from the Window menu to the Options menu. https://bugs.python.org/issue22703
Diffstat (limited to 'Lib/idlelib/zoomheight.py')
-rw-r--r--Lib/idlelib/zoomheight.py6
1 files changed, 5 insertions, 1 deletions
diff --git a/Lib/idlelib/zoomheight.py b/Lib/idlelib/zoomheight.py
index 73f1df0..35e285f 100644
--- a/Lib/idlelib/zoomheight.py
+++ b/Lib/idlelib/zoomheight.py
@@ -13,7 +13,10 @@ class ZoomHeight:
def zoom_height_event(self, event=None):
top = self.editwin.top
- zoom_height(top)
+ zoomed = zoom_height(top)
+ menu_status = 'Restore' if zoomed else 'Zoom'
+ self.editwin.update_menu_label(menu='options', index='* Height',
+ label=f'{menu_status} Height')
return "break"
@@ -46,6 +49,7 @@ def zoom_height(top):
else:
newgeom = "%dx%d+%d+%d" % (width, newheight, x, newy)
top.wm_geometry(newgeom)
+ return newgeom != ""
if __name__ == "__main__":