Skip to content

Commit

Permalink
wxGUI/Single-Window: arrange a startup GUI (OSGeo#1775)
Browse files Browse the repository at this point in the history
notebook size set according to modules tab
  • Loading branch information
lindakarlovska authored Aug 17, 2021
1 parent 97233d6 commit 319b6bb
Showing 1 changed file with 14 additions and 6 deletions.
20 changes: 14 additions & 6 deletions gui/wxpython/main_window/frame.py
Original file line number Diff line number Diff line change
Expand Up @@ -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()
Expand Down Expand Up @@ -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)
Expand All @@ -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(
Expand All @@ -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()
Expand Down

0 comments on commit 319b6bb

Please sign in to comment.