diff --git a/CHANGES.rst b/CHANGES.rst index 5aa598f9..e6d8398f 100644 --- a/CHANGES.rst +++ b/CHANGES.rst @@ -164,6 +164,7 @@ Changes in this release include the following: * Fixed the stock labels to conform to Windows design guidelines. (#787) +* Always reset floating size and style when floating a toolbar in agw.aui. (#880) diff --git a/wx/lib/agw/aui/framemanager.py b/wx/lib/agw/aui/framemanager.py index b6a3f6fe..b13685fb 100644 --- a/wx/lib/agw/aui/framemanager.py +++ b/wx/lib/agw/aui/framemanager.py @@ -6444,6 +6444,18 @@ class AuiManager(wx.EvtHandler): pFrame = p.frame if p.IsFloating(): + if p.IsToolbar(): + bar = p.window + if isinstance(bar, auibar.AuiToolBar): + bar.SetGripperVisible(False) + agwStyle = bar.GetAGWWindowStyleFlag() + bar.SetAGWWindowStyleFlag(agwStyle & ~AUI_TB_VERTICAL) + bar.Realize() + + s = p.window.GetMinSize() + p.BestSize(s) + p.FloatingSize(wx.DefaultSize) + if pFrame is None: # we need to create a frame for this # pane, which has recently been floated @@ -6456,18 +6468,6 @@ class AuiManager(wx.EvtHandler): self._agwFlags & AUI_MGR_TRANSPARENT_DRAG: frame.SetTransparent(150) - if p.IsToolbar(): - bar = p.window - if isinstance(bar, auibar.AuiToolBar): - bar.SetGripperVisible(False) - agwStyle = bar.GetAGWWindowStyleFlag() - bar.SetAGWWindowStyleFlag(agwStyle & ~AUI_TB_VERTICAL) - bar.Realize() - - s = p.window.GetMinSize() - p.BestSize(s) - p.FloatingSize(wx.DefaultSize) - frame.SetPaneWindow(p) p.needsTransparency = True p.frame = pFrame = frame