Ignore:
Timestamp:
02/08/23 01:19:53 (19 months ago)
Author:
Maciej Komosinski
Message:

Introduced common utility functions for setting window sizes; untangled some repeated code

File:
1 edited

Legend:

Unmodified
Added
Removed
  • framspy/gui/widgets/mainPage.py

    r1201 r1202  
    1616from gui.socketInterface import SocketInterface
    1717from gui.utils import debounce
     18from gui.utils import windowHideAndMaximize, windowShowAndSetGeometry
    1819from gui.widgets.ToolTip import CreateToolTip
    1920from time import perf_counter
     
    171172        #ORGANIZE WINDOWS POSITIONS
    172173        ## need to do some workaround to determine screen width and height
    173         self.attributes("-alpha", 0)
    174         self.state('zoomed')
    175         self.update()
     174        windowHideAndMaximize(self)
    176175        maxHeight = self.winfo_rooty() + self.winfo_height()
    177176        maxWidth = self.winfo_rootx() + self.winfo_width()
    178177        self.rootx = self.winfo_rootx()
    179         self.state("normal")
    180         self.update()
    181         self.geometry("%dx%d+%d+%d" % (self.OPENGL_WIDTH + self.SIDEBAR_WIDTH, self.OPENGL_HEIGHT, self.rootx, 0))
    182         self.attributes("-alpha", 1)
    183         self.update()
     178        windowShowAndSetGeometry(self, "%dx%d+%d+%d" % (self.OPENGL_WIDTH + self.SIDEBAR_WIDTH, self.OPENGL_HEIGHT, self.rootx, 0))
    184179        height = self.winfo_rooty() + self.winfo_height() - self.winfo_y()
    185180
Note: See TracChangeset for help on using the changeset viewer.