diff options
author | Blaine | 2020-04-29 11:44:33 +0530 |
---|---|---|
committer | Blaine | 2020-04-29 11:44:33 +0530 |
commit | 6b5859af7ae5097baa2401eb25816cc8a6191a77 (patch) | |
tree | 0d6abe9e952f9e88ed1a77e323e962b0d6bdce3d /src/main/python/utils | |
parent | 6d3259d56837b172ce8957fd28c0fa3436066262 (diff) | |
download | Chemical-PFD-6b5859af7ae5097baa2401eb25816cc8a6191a77.tar.gz Chemical-PFD-6b5859af7ae5097baa2401eb25816cc8a6191a77.tar.bz2 Chemical-PFD-6b5859af7ae5097baa2401eb25816cc8a6191a77.zip |
add state change markers
Diffstat (limited to 'src/main/python/utils')
-rw-r--r-- | src/main/python/utils/fileWindow.py | 19 |
1 files changed, 16 insertions, 3 deletions
diff --git a/src/main/python/utils/fileWindow.py b/src/main/python/utils/fileWindow.py index 99f1f70..c4cf128 100644 --- a/src/main/python/utils/fileWindow.py +++ b/src/main/python/utils/fileWindow.py @@ -32,6 +32,8 @@ class fileWindow(QMdiSubWindow): self.setContextMenuPolicy(Qt.CustomContextMenu) self.customContextMenuRequested.connect(self.contextMenu) + self.windowStateChanged.connect(self.stateChange) + def changeTab(self, currentIndex): #placeholder function to detect tab change self.resizeHandler() @@ -48,9 +50,9 @@ class fileWindow(QMdiSubWindow): diagram.setObjectName("New") self.tabber.addTab(diagram, "New") - def resizeHandler(self, parent = None): + def resizeHandler(self): # experimental resize Handler to handle resize on parent resize. - parentRect = parent.parentWidget().rect() if parent else self.parentWidget().parentWidget().rect() + parentRect = self.mdiArea().rect() current = self.tabber.currentWidget() width, height = current.dimensions width = min(parentRect.width(), width + 100) @@ -74,7 +76,18 @@ class fileWindow(QMdiSubWindow): def resizeEvent(self, event): self.resizeHandler() super(fileWindow, self).resizeEvent(event) - + + def stateChange(self, oldState, newState): + if newState == Qt.WindowMinimized: + print("minimized") + elif newState == Qt.WindowFullScreen: + print("maximized") + else: + if oldState == Qt.WindowMinimized: + print("min to full") + else: + print("max to full") + @property def tabList(self): #returns a list of tabs in the given window |