You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
classUIFunctions(MainWindow):
## ==> MAXIMIZE RESTORE FUNCTIONdefmaximize_restore(self):
globalGLOBAL_STATEstatus=GLOBAL_STATE# IF NOT MAXIMIZEDifstatus==0:
self.showMaximized()
# SET GLOBAL TO 1GLOBAL_STATE=1# IF MAXIMIZED REMOVE MARGINS AND BORDER RADIUSself.ui.btn_maximize.setToolTip("Restore")
else:
GLOBAL_STATE=0self.showNormal()
self.resize(self.width()+1, self.height()+1)
self.ui.btn_maximize.setToolTip("Maximize")
## ==> UI DEFINITIONSdefuiDefinitions(self):
# MAXIMIZE / RESTOREself.ui.btn_maximize.clicked.connect(lambda: UIFunctions.maximize_restore(self))
# MINIMIZEself.ui.btn_minimize.clicked.connect(lambda: self.showMinimized())
# CLOSEself.ui.btn_close.clicked.connect(lambda: self.close())
## RETURN STATUS IF WINDOWS IS MAXIMIZE OR RESTAUREDdefreturnStatus():
returnGLOBAL_STATE# In the Class # MOVE WINDOWdefmoveWindow(event):
# RESTORE BEFORE MOVEifUIFunctions.returnStatus() ==1:
UIFunctions.maximize_restore(self)
# IF LEFT CLICK MOVE WINDOWifevent.buttons() ==Qt.LeftButton:
self.move(self.pos() +event.globalPos() -self.dragPos)
self.dragPos=event.globalPos()
event.accept()
# SET TITLE BARself.ui.title_bar.mouseMoveEvent=moveWindow## ==> SET UI DEFINITIONSUIFunctions.uiDefinitions(self)