From 319b6bbcaedd7fbc7d85bf7d23cdcac71d55b8b8 Mon Sep 17 00:00:00 2001 From: Linda Kladivova <49241681+lindakladivova@users.noreply.github.com> Date: Tue, 17 Aug 2021 11:33:02 -0500 Subject: [PATCH] wxGUI/Single-Window: arrange a startup GUI (#1775) notebook size set according to modules tab --- gui/wxpython/main_window/frame.py | 20 ++++++++++++++------ 1 file changed, 14 insertions(+), 6 deletions(-) diff --git a/gui/wxpython/main_window/frame.py b/gui/wxpython/main_window/frame.py index 41df1152aec..4cd6715e0c4 100644 --- a/gui/wxpython/main_window/frame.py +++ b/gui/wxpython/main_window/frame.py @@ -156,7 +156,7 @@ def show_menu_errors(messages): # set pane sizes according to the full screen size of the primary monitor size = wx.Display().GetGeometry().GetSize() self.PANE_BEST_SIZE = tuple(t / 3 for t in size) - self.PANE_MIN_SIZE = tuple(t / 7 for t in size) + self.PANE_MIN_SIZE = tuple(t / 5 for t in size) # create widgets and build panes self.CreateMenuBar() @@ -611,7 +611,7 @@ def BuildPanes(self): .Name("modules") .Caption("Modules") .Right() - .Layer(2) + .Layer(1) .Position(1) .BestSize(self.PANE_BEST_SIZE) .MinSize(self.PANE_MIN_SIZE) @@ -626,13 +626,12 @@ def BuildPanes(self): .Name("console") .Caption("Console") .Right() - .Layer(2) - .Position(2) .BestSize(self.PANE_BEST_SIZE) .MinSize(self.PANE_MIN_SIZE) .CloseButton(False) .MinimizeButton(True) .MaximizeButton(True), + target=self._auimgr.GetPane("modules"), ) self._auimgr.AddPane( @@ -641,16 +640,25 @@ def BuildPanes(self): .Name("python") .Caption("Python") .Right() - .Layer(2) - .Position(3) .BestSize(self.PANE_BEST_SIZE) .MinSize(self.PANE_MIN_SIZE) .CloseButton(False) .MinimizeButton(True) .MaximizeButton(True), + target=self._auimgr.GetPane("modules"), ) self._auimgr.GetPane("toolbarNviz").Hide() + + # Set Modules as active tab + modules = self._auimgr.GetPane("modules") + notebook = self._auimgr.GetNotebooks()[0] + notebook.SetSelectionToPage(modules) + + # Set the size for automatic notebook + pane = self._auimgr.GetPane(notebook) + pane.MinSize(self.search.GetMinSize()) + wx.CallAfter(self.datacatalog.LoadItems) self._auimgr.Update()