mirror of
https://github.com/python/cpython.git
synced 2025-07-23 19:25:40 +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):
|
||||
top = self.editwin.top
|
||||
geom = top.wm_geometry()
|
||||
m = re.match(r"(\d+)x(\d+)\+(-?\d+)\+(-?\d+)", geom)
|
||||
if not m:
|
||||
top.bell()
|
||||
return
|
||||
width, height, x, y = map(int, m.groups())
|
||||
newheight = top.winfo_screenheight()
|
||||
if sys.platform == 'win32':
|
||||
newy = 0
|
||||
newheight = newheight - 72
|
||||
else:
|
||||
newy = 24
|
||||
newheight = newheight - 96
|
||||
if height >= newheight:
|
||||
newgeom = ""
|
||||
else:
|
||||
newgeom = "%dx%d+%d+%d" % (width, newheight, x, newy)
|
||||
top.wm_geometry(newgeom)
|
||||
zoom_height(top)
|
||||
|
||||
def zoom_height(top):
|
||||
geom = top.wm_geometry()
|
||||
m = re.match(r"(\d+)x(\d+)\+(-?\d+)\+(-?\d+)", geom)
|
||||
if not m:
|
||||
top.bell()
|
||||
return
|
||||
width, height, x, y = map(int, m.groups())
|
||||
newheight = top.winfo_screenheight()
|
||||
if sys.platform == 'win32':
|
||||
newy = 0
|
||||
newheight = newheight - 72
|
||||
else:
|
||||
newy = 24
|
||||
newheight = newheight - 96
|
||||
if height >= newheight:
|
||||
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