mirror of
https://github.com/wxWidgets/Phoenix.git
synced 2026-01-07 20:40:11 +01:00
Invalidate the cached best size whenever something changes that could affect the best size
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxPython/Phoenix/trunk@73342 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -481,8 +481,6 @@ class PyCollapsiblePane(wx.Panel):
|
||||
:param `sz`: an instance of :class:`Size`.
|
||||
"""
|
||||
|
||||
# minimal size has priority over the best size so set here our min size
|
||||
self.SetMinSize(sz)
|
||||
self.SetSize(sz)
|
||||
|
||||
if self.HasAGWFlag(wx.CP_NO_TLW_RESIZE):
|
||||
@@ -534,7 +532,7 @@ class PyCollapsiblePane(wx.Panel):
|
||||
# collapsed . expanded transition
|
||||
|
||||
# force our parent to "fit", i.e. expand so that it can honour
|
||||
# our minimal size
|
||||
# our best size
|
||||
top.Fit()
|
||||
|
||||
|
||||
@@ -554,6 +552,8 @@ class PyCollapsiblePane(wx.Panel):
|
||||
# update our state
|
||||
self._pPane.Show(not collapse)
|
||||
self._bCollapsed = collapse
|
||||
self.InvalidateBestSize()
|
||||
|
||||
self.Thaw()
|
||||
|
||||
# update button label
|
||||
@@ -603,7 +603,8 @@ class PyCollapsiblePane(wx.Panel):
|
||||
self._pButton.SetLabel(self.GetBtnLabel())
|
||||
self._pButton.SetInitialSize()
|
||||
self._pButton.Refresh()
|
||||
|
||||
self.InvalidateBestSize()
|
||||
|
||||
self.Layout()
|
||||
|
||||
|
||||
@@ -625,6 +626,7 @@ class PyCollapsiblePane(wx.Panel):
|
||||
"""
|
||||
|
||||
self._pButton.SetFont(font)
|
||||
self.InvalidateBestSize()
|
||||
self.Layout()
|
||||
|
||||
|
||||
@@ -656,6 +658,7 @@ class PyCollapsiblePane(wx.Panel):
|
||||
"""
|
||||
|
||||
self._expanderDimensions = width, height
|
||||
self.InvalidateBestSize()
|
||||
if self._sz:
|
||||
self._sz.Layout()
|
||||
if self._pButton:
|
||||
@@ -778,6 +781,7 @@ class PyCollapsiblePane(wx.Panel):
|
||||
|
||||
if self._pPane:
|
||||
self._pButton.MoveBeforeInTabOrder(self._pPane)
|
||||
self.InvalidateBestSize()
|
||||
self.Layout()
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user