cascade/tile enforces Multiple windows; turn on/off frame to hide min/max/close buttons under Single window
This commit is contained in:
@ -1,4 +1,4 @@
|
||||
from PyQt5.QtWidgets import QMdiArea, QAction, QActionGroup
|
||||
from PyQt5.QtWidgets import QMdiArea, QAction
|
||||
from PyQt5.QtGui import QPainter
|
||||
|
||||
from .. import assets
|
||||
@ -31,10 +31,12 @@ class MDIArea(QMdiArea):
|
||||
|
||||
|
||||
def on_cascade(self):
|
||||
self.menu.checkboxes["Multiple windows"].setChecked(True)
|
||||
self.enable_subwindow_view()
|
||||
self.cascadeSubWindows()
|
||||
|
||||
def on_tile(self):
|
||||
self.menu.checkboxes["Multiple windows"].setChecked(True)
|
||||
self.enable_subwindow_view()
|
||||
self.tileSubWindows()
|
||||
|
||||
@ -44,9 +46,12 @@ class MDIArea(QMdiArea):
|
||||
active = self.activeSubWindow()
|
||||
if active:
|
||||
active.showMaximized()
|
||||
active.frame_off()
|
||||
|
||||
def enable_subwindow_view(self):
|
||||
self.setViewMode(QMdiArea.SubWindowView)
|
||||
for sub in self.subWindowList():
|
||||
sub.frame_on()
|
||||
|
||||
def enable_tabbed_view(self):
|
||||
self.setViewMode(QMdiArea.TabbedView)
|
||||
@ -67,6 +72,7 @@ class MDIArea(QMdiArea):
|
||||
self.closeAllSubWindows()
|
||||
self.addSubWindow(sub)
|
||||
sub.showMaximized()
|
||||
sub.frame_off()
|
||||
|
||||
|
||||
def paintEvent(self, _event):
|
||||
|
Reference in New Issue
Block a user