Commit 21e15235 authored by Guido van Rossum's avatar Guido van Rossum

Move zoom height functionality to separate function.

parent 5bb7bb90
...@@ -23,21 +23,24 @@ class ZoomHeight: ...@@ -23,21 +23,24 @@ class ZoomHeight:
def zoom_height_event(self, event): def zoom_height_event(self, event):
top = self.editwin.top top = self.editwin.top
geom = top.wm_geometry() zoom_height(top)
m = re.match(r"(\d+)x(\d+)\+(-?\d+)\+(-?\d+)", geom)
if not m: def zoom_height(top):
top.bell() geom = top.wm_geometry()
return m = re.match(r"(\d+)x(\d+)\+(-?\d+)\+(-?\d+)", geom)
width, height, x, y = map(int, m.groups()) if not m:
newheight = top.winfo_screenheight() top.bell()
if sys.platform == 'win32': return
newy = 0 width, height, x, y = map(int, m.groups())
newheight = newheight - 72 newheight = top.winfo_screenheight()
else: if sys.platform == 'win32':
newy = 24 newy = 0
newheight = newheight - 96 newheight = newheight - 72
if height >= newheight: else:
newgeom = "" newy = 24
else: newheight = newheight - 96
newgeom = "%dx%d+%d+%d" % (width, newheight, x, newy) if height >= newheight:
top.wm_geometry(newgeom) newgeom = ""
else:
newgeom = "%dx%d+%d+%d" % (width, newheight, x, newy)
top.wm_geometry(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