mirror of
https://github.com/python/cpython.git
synced 2025-09-10 02:36:56 +00:00
Move zoom height functionality to separate function.
This commit is contained in:
parent
5fac2ab220
commit
96cf271be9
1 changed files with 21 additions and 18 deletions
|
@ -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)
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue