From 9221cbef4b08d0bf8c67871f53dcbb885f9edf51 Mon Sep 17 00:00:00 2001 From: Robin Dunn Date: Wed, 13 Jun 2018 19:12:02 -0700 Subject: [PATCH] Merge pull request #881 from tianzhuqiao/agw_aui_4.0.x Always reset floating size and style when floating a toolbar in agw.aui. (cherry picked from commit 4ab2ea68338bec785f473d88ca6209765d3acd00) --- CHANGES.rst | 1 + wx/lib/agw/aui/framemanager.py | 24 ++++++++++++------------ 2 files changed, 13 insertions(+), 12 deletions(-) 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