Skip to content

Commit

Permalink
More tool bar tweakage
Browse files Browse the repository at this point in the history
  • Loading branch information
EarToEarOak committed Nov 19, 2015
1 parent 186d865 commit 9844dfd
Show file tree
Hide file tree
Showing 2 changed files with 19 additions and 10 deletions.
27 changes: 18 additions & 9 deletions src/main_window.py
Original file line number Diff line number Diff line change
Expand Up @@ -243,12 +243,9 @@ def __create_toolbars(self):
grid1.Add(self.spinCtrlStop, pos=(1, 6))
grid1.Add(textGain, pos=(0, 7), flag=wx.ALIGN_CENTER)
grid1.Add(self.controlGain, pos=(1, 7), flag=wx.ALIGN_CENTER)
grid1.Add((5, 1), pos=(0, 8))
grid1.AddGrowableCol(2)

self.toolbar1.SetSizerAndFit(grid1)
self.toolbar1.Layout()
toolSize1 = self.toolbar1.GetMinSize()

self.toolbar2 = wx.Window(self)

textMode = wx.StaticText(self.toolbar2, label="Mode")
Expand Down Expand Up @@ -280,8 +277,12 @@ def __create_toolbars(self):
grid2.Add((20, 1), pos=(0, 3))
grid2.Add(textDisplay, pos=(0, 4), flag=wx.ALIGN_CENTER)
grid2.Add(self.choiceDisplay, pos=(1, 4), flag=wx.ALIGN_CENTER)
grid2.Add((5, 1), pos=(0, 5))
grid2.AddGrowableCol(3)

self.toolbar1.SetSizerAndFit(grid1)
self.toolbar1.Layout()
toolSize1 = self.toolbar1.GetMinSize()
self.toolbar2.SetSizerAndFit(grid2)
self.toolbar2.Layout()
toolSize2 = self.toolbar2.GetMinSize()
Expand All @@ -294,7 +295,9 @@ def __create_toolbars(self):
Centre().
CentrePane())
self._mgr.AddPane(self.toolbar1, aui.AuiPaneInfo().
ToolbarPane().
Bottom().
Layer(1).
LeftDockable(False).
RightDockable(False).
NotebookDockable(False).
Expand All @@ -305,7 +308,9 @@ def __create_toolbars(self):
MinimizeButton(True).
MinSize(toolSize1))
self._mgr.AddPane(self.toolbar2, aui.AuiPaneInfo().
ToolbarPane().
Bottom().
Layer(2).
LeftDockable(False).
RightDockable(False).
NotebookDockable(False).
Expand Down Expand Up @@ -1206,11 +1211,15 @@ def __set_size(self):
toolSize1 = self.toolbar1.GetMinSize()
toolSize2 = self.toolbar2.GetMinSize()

if width < (toolSize1[0] + toolSize2[0] +
(widthBorder * 2) +
(widthFrame * 2)):
self._mgr.GetPane(self.toolbar2).Layer(1)
self._mgr.Update()
paneTool1 = self._mgr.GetPane(self.toolbar1)
paneTool2 = self._mgr.GetPane(self.toolbar2)
if width >= (toolSize1[0] + toolSize2[0] +
(widthBorder * 2) +
(widthFrame * 2)):
paneTool1.ToolbarPane()
paneTool2.ToolbarPane()
paneTool2.Layer(1)
self._mgr.Update()

minWidth = max(toolSize1[0], toolSize2[0]) + widthBorder
minWidth = max(minWidth, 640)
Expand Down
2 changes: 1 addition & 1 deletion src/version-timestamp
Original file line number Diff line number Diff line change
@@ -1 +1 @@
1447889903
1447895477

0 comments on commit 9844dfd

Please sign in to comment.