bpo-37039: IDLE - zoomheight fixes (GH-13576) · python/cpython@df9b032 (original) (raw)

Original file line number Diff line number Diff line change
@@ -28,26 +28,14 @@ def zoom_height(top):
28 28 return
29 29 width, height, x, y = map(int, m.groups())
30 30 newheight = top.winfo_screenheight()
31 -if sys.platform == 'win32':
32 -newy = 0
33 -newheight = newheight - 72
34 -
35 -elif macosx.isAquaTk():
36 -# The '88' below is a magic number that avoids placing the bottom
37 -# of the window below the panel on my machine. I don't know how
38 -# to calculate the correct value for this with tkinter.
39 -newy = 22
40 -newheight = newheight - newy - 88
41 -
42 -else:
43 -#newy = 24
44 -newy = 0
45 -#newheight = newheight - 96
46 -newheight = newheight - 88
47 -if height >= newheight:
48 -newgeom = ""
49 -else:
50 -newgeom = "%dx%d+%d+%d" % (width, newheight, x, newy)
31 +
32 +# The constants below for Windows and Mac Aqua are visually determined
33 +# to avoid taskbar or menubar and app icons.
34 +newy, bot_y = ((0, 72) if sys.platform == 'win32' else
35 + (22, 88) if macosx.isAquaTk() else
36 + (0, 88) ) # Guess for anything else.
37 +newheight = newheight - newy - bot_y
38 +newgeom = '' if height >= newheight else f"{width}x{newheight}+{x}+{newy}"
51 39 top.wm_geometry(newgeom)
52 40 return newgeom != ""
53 41