Commit df9b032f authored by Terry Jan Reedy's avatar Terry Jan Reedy Committed by GitHub

bpo-37039: IDLE - zoomheight fixes (GH-13576)

Move doc entry to match menu and refactor zoom function.
A followup patch will include a blurb.
parent cd590a7c
...@@ -281,16 +281,16 @@ Configure IDLE ...@@ -281,16 +281,16 @@ Configure IDLE
menu. For more, see menu. For more, see
:ref:`Setting preferences <preferences>` under Help and preferences. :ref:`Setting preferences <preferences>` under Help and preferences.
Zoom/Restore Height
Toggles the window between normal size and maximum height. The initial size
defaults to 40 lines by 80 chars unless changed on the General tab of the
Configure IDLE dialog.
Show/Hide Code Context (Editor Window only) Show/Hide Code Context (Editor Window only)
Open a pane at the top of the edit window which shows the block context Open a pane at the top of the edit window which shows the block context
of the code which has scrolled above the top of the window. See of the code which has scrolled above the top of the window. See
:ref:`Code Context <code-context>` in the Editing and Navigation section below. :ref:`Code Context <code-context>` in the Editing and Navigation section below.
Zoom/Restore Height
Toggles the window between normal size and maximum height. The initial size
defaults to 40 lines by 80 chars unless changed on the General tab of the
Configure IDLE dialog.
Window menu (Shell and Editor) Window menu (Shell and Editor)
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
......
...@@ -313,14 +313,14 @@ size, additional help sources, and extensions. On macOS, open the ...@@ -313,14 +313,14 @@ size, additional help sources, and extensions. On macOS, open the
configuration dialog by selecting Preferences in the application configuration dialog by selecting Preferences in the application
menu. For more, see menu. For more, see
<a class="reference internal" href="#preferences"><span class="std std-ref">Setting preferences</span></a> under Help and preferences.</dd> <a class="reference internal" href="#preferences"><span class="std std-ref">Setting preferences</span></a> under Help and preferences.</dd>
<dt>Zoom/Restore Height</dt>
<dd>Toggles the window between normal size and maximum height. The initial size
defaults to 40 lines by 80 chars unless changed on the General tab of the
Configure IDLE dialog.</dd>
<dt>Show/Hide Code Context (Editor Window only)</dt> <dt>Show/Hide Code Context (Editor Window only)</dt>
<dd>Open a pane at the top of the edit window which shows the block context <dd>Open a pane at the top of the edit window which shows the block context
of the code which has scrolled above the top of the window. See of the code which has scrolled above the top of the window. See
<a class="reference internal" href="#code-context"><span class="std std-ref">Code Context</span></a> in the Editing and Navigation section below.</dd> <a class="reference internal" href="#code-context"><span class="std std-ref">Code Context</span></a> in the Editing and Navigation section below.</dd>
<dt>Zoom/Restore Height</dt>
<dd>Toggles the window between normal size and maximum height. The initial size
defaults to 40 lines by 80 chars unless changed on the General tab of the
Configure IDLE dialog.</dd>
</dl> </dl>
</div> </div>
<div class="section" id="window-menu-shell-and-editor"> <div class="section" id="window-menu-shell-and-editor">
...@@ -943,7 +943,7 @@ also used for testing.</p> ...@@ -943,7 +943,7 @@ also used for testing.</p>
<br /> <br />
<br /> <br />
Last updated on May 19, 2019. Last updated on May 25, 2019.
<a href="https://docs.python.org/3/bugs.html">Found a bug</a>? <a href="https://docs.python.org/3/bugs.html">Found a bug</a>?
<br /> <br />
......
...@@ -28,26 +28,14 @@ def zoom_height(top): ...@@ -28,26 +28,14 @@ def zoom_height(top):
return return
width, height, x, y = map(int, m.groups()) width, height, x, y = map(int, m.groups())
newheight = top.winfo_screenheight() newheight = top.winfo_screenheight()
if sys.platform == 'win32':
newy = 0 # The constants below for Windows and Mac Aqua are visually determined
newheight = newheight - 72 # to avoid taskbar or menubar and app icons.
newy, bot_y = ((0, 72) if sys.platform == 'win32' else
elif macosx.isAquaTk(): (22, 88) if macosx.isAquaTk() else
# The '88' below is a magic number that avoids placing the bottom (0, 88) ) # Guess for anything else.
# of the window below the panel on my machine. I don't know how newheight = newheight - newy - bot_y
# to calculate the correct value for this with tkinter. newgeom = '' if height >= newheight else f"{width}x{newheight}+{x}+{newy}"
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)
top.wm_geometry(newgeom) top.wm_geometry(newgeom)
return newgeom != "" return newgeom != ""
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment