Skip to content

Commit

Permalink
Fix additions toggle to fully collapse
Browse files Browse the repository at this point in the history
  • Loading branch information
blitzmann committed Oct 4, 2015
1 parent 9465ace commit ae3bd9d
Show file tree
Hide file tree
Showing 2 changed files with 20 additions and 1 deletion.
19 changes: 19 additions & 0 deletions gui/additionsPane.py
Original file line number Diff line number Diff line change
Expand Up @@ -46,6 +46,7 @@ def __init__(self, parent):

self.notebook = gui.chromeTabs.PFNotebook(pane, False)
self.notebook.SetMinSize((-1, 1000))

baseSizer.Add(self.notebook, 1, wx.EXPAND)

droneImg = BitmapLoader.getImage("drone_small", "gui")
Expand Down Expand Up @@ -73,3 +74,21 @@ def select(self, name):

def getName(self, idx):
return self.PANES[idx]

def toggleContent(self, event):
TogglePanel.toggleContent(self, event)
h = self.headerPanel.GetSize()[1]+4

if self.IsCollapsed():
self.old_pos = self.parent.GetSashPosition()
self.parent.SetMinimumPaneSize(h)
self.parent.SetSashPosition(h*-1, True)
# only available in >= wx2.9
if getattr(self.parent, "SetSashInvisible", None):
self.parent.SetSashInvisible(True)
else:
if getattr(self.parent, "SetSashInvisible", None):
self.parent.SetSashInvisible(False)
self.parent.SetMinimumPaneSize(200)
self.parent.SetSashPosition(self.old_pos, True)

2 changes: 1 addition & 1 deletion gui/pyfatogglepanel.py
Original file line number Diff line number Diff line change
Expand Up @@ -186,7 +186,7 @@ def OnStateChange(self, sz):
# Toggle the content panel (hide/show)
def toggleContent(self, event):
self.Freeze()
print self.contentPanel.GetSize()

if self._toggle == 1:
self.contentMinSize = self.contentPanel.GetSize()
self.contentPanel.Hide()
Expand Down

0 comments on commit ae3bd9d

Please sign in to comment.