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 4ab2ea6833)
This commit is contained in:
Robin Dunn
2018-06-13 19:12:02 -07:00
parent f05dd675e5
commit 9221cbef4b
2 changed files with 13 additions and 12 deletions

View File

@@ -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)

View File

@@ -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