feat: added window mode tabs

This commit is contained in:
2023-01-18 17:38:33 +01:00
parent ab233255fa
commit 4ccef8f8a4
2 changed files with 8 additions and 2 deletions

View File

@ -26,7 +26,7 @@ def handle_clargs():
parser.add_argument("-e", "--examples", dest="add_examples", action="store_true", help="Add example data")
parser.add_argument("-w", "--window_mode", default="multi", type=str, help="Set the window mode to either 'single' or 'multi'.")
parser.add_argument("-w", "--window_mode", default="multi", type=str, help="Set the window mode to either 'single', 'multi' or 'tabs'.")
return parser.parse_args().__dict__

View File

@ -9,6 +9,7 @@ from ..menus import BarMenu
class MDIWindowMode(str, enum.Enum):
SINGLE = "single"
MULTI = "multi"
TABS = "Tabbed"
class MDIArea(QMdiArea):
@ -34,7 +35,12 @@ class MDIArea(QMdiArea):
menu.addAction("Close inactive", self.closeInactiveSubWindows)
def _window_mode_to_menu(self, mode:MDIWindowMode) -> str:
return "Single window" if mode == MDIWindowMode.SINGLE else "Multiple windows"
if mode == MDIWindowMode.SINGLE:
return "Single window"
if mode == MDIWindowMode.MULTI:
return "Multiple windows"
if mode == MDIWindowMode.TABS:
return "Tabbed"
def set_window_mode(self, mode:MDIWindowMode) -> None:
checkbox = self._window_mode_to_menu(mode)