argument with minus instead of underscore; "Tabbed" -> "tabs" in enum; some new lines

This commit is contained in:
2023-01-20 17:32:36 +01:00
parent 4ccef8f8a4
commit 011ce28feb
3 changed files with 7 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', 'multi' or 'tabs'.")
parser.add_argument("-w", "--window-mode", default="multi", help='Set the window mode to either "single", "multi" or "tabs"')
return parser.parse_args().__dict__

View File

@ -80,6 +80,7 @@ class MainWindow(QMainWindow):
def ping(self):
return "pong"
# Signal callbacks
def on_make_new_plot(self, *args, **kwargs):

View File

@ -6,10 +6,12 @@ from .. import assets
from ..theme import MDI_BKG
from ..menus import BarMenu
class MDIWindowMode(str, enum.Enum):
SINGLE = "single"
MULTI = "multi"
TABS = "Tabbed"
TABS = "tabs"
class MDIArea(QMdiArea):
@ -34,6 +36,7 @@ class MDIArea(QMdiArea):
menu.addAction("Close all", self.closeAllSubWindows)
menu.addAction("Close inactive", self.closeInactiveSubWindows)
def _window_mode_to_menu(self, mode:MDIWindowMode) -> str:
if mode == MDIWindowMode.SINGLE:
return "Single window"
@ -46,6 +49,7 @@ class MDIArea(QMdiArea):
checkbox = self._window_mode_to_menu(mode)
self.menu.checkboxes[checkbox].setChecked(True)
def on_cascade(self):
self.menu.checkboxes["Multiple windows"].setChecked(True)
self.enable_subwindow_view()