summaryrefslogtreecommitdiffstats
path: root/Lib/idlelib/zoomheight.py
diff options
context:
space:
mode:
authorTerry Jan Reedy <tjreedy@udel.edu>2019-05-27 23:16:46 (GMT)
committerGitHub <noreply@github.com>2019-05-27 23:16:46 (GMT)
commitdf9b032f47e4edaf306d95449370e565ee470018 (patch)
treed7943dbf0fa8a705d5a626e482a119bbf09c66d7 /Lib/idlelib/zoomheight.py
parentcd590a7cede156a4244e7cac61e4504e5344d842 (diff)
downloadcpython-df9b032f47e4edaf306d95449370e565ee470018.zip
cpython-df9b032f47e4edaf306d95449370e565ee470018.tar.gz
cpython-df9b032f47e4edaf306d95449370e565ee470018.tar.bz2
bpo-37039: IDLE - zoomheight fixes (GH-13576)
Move doc entry to match menu and refactor zoom function. A followup patch will include a blurb.
Diffstat (limited to 'Lib/idlelib/zoomheight.py')
-rw-r--r--Lib/idlelib/zoomheight.py28
1 files changed, 8 insertions, 20 deletions
diff --git a/Lib/idlelib/zoomheight.py b/Lib/idlelib/zoomheight.py
index 35e285f..523f5d5 100644
--- a/Lib/idlelib/zoomheight.py
+++ b/Lib/idlelib/zoomheight.py
@@ -28,26 +28,14 @@ def zoom_height(top):
return
width, height, x, y = map(int, m.groups())
newheight = top.winfo_screenheight()
- if sys.platform == 'win32':
- newy = 0
- newheight = newheight - 72
-
- elif macosx.isAquaTk():
- # The '88' below is a magic number that avoids placing the bottom
- # of the window below the panel on my machine. I don't know how
- # to calculate the correct value for this with tkinter.
- newy = 22
- newheight = newheight - newy - 88
-
- else:
- #newy = 24
- newy = 0
- #newheight = newheight - 96
- newheight = newheight - 88
- if height >= newheight:
- newgeom = ""
- else:
- newgeom = "%dx%d+%d+%d" % (width, newheight, x, newy)
+
+ # The constants below for Windows and Mac Aqua are visually determined
+ # to avoid taskbar or menubar and app icons.
+ newy, bot_y = ((0, 72) if sys.platform == 'win32' else
+ (22, 88) if macosx.isAquaTk() else
+ (0, 88) ) # Guess for anything else.
+ newheight = newheight - newy - bot_y
+ newgeom = '' if height >= newheight else f"{width}x{newheight}+{x}+{newy}"
top.wm_geometry(newgeom)
return newgeom != ""