feat: added window mode tabs
This commit is contained in:
@ -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__
|
||||
|
||||
|
@ -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)
|
||||
|
Reference in New Issue
Block a user