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
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 @@
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 @@
else:
newgeom = "%dx%d+%d+%d" % (width, newheight, x, newy)
top.wm_geometry(newgeom)
+ return newgeom != ""
if __name__ == "__main__":