avoid code duplication between the generic and GTK versions, factor the common code out in OnStateChange()
git-svn-id: https://svn.wxwidgets.org/svn/wx/wxWidgets/trunk@42264 c3d73ce0-8a6f-49c7-b76d-6d57e0e08775
This commit is contained in:
@@ -72,33 +72,7 @@ static void gtk_collapsiblepane_expanded_callback (GObject *object,
|
||||
sz = p->m_szCollapsed;
|
||||
}
|
||||
|
||||
// minimal size has priority over the best size so set here our min size
|
||||
p->SetMinSize(sz);
|
||||
p->SetSize(sz);
|
||||
|
||||
wxWindow *top = wxGetTopLevelParent(p);
|
||||
if (top)
|
||||
{
|
||||
// we've changed our size, thus our top level parent needs to relayout
|
||||
// itself
|
||||
top->Layout();
|
||||
|
||||
if (p->IsExpanded())
|
||||
{
|
||||
// force our parent to "fit", i.e. expand so that it can honour
|
||||
// our minimal size
|
||||
top->Fit();
|
||||
}
|
||||
else // correctly
|
||||
{
|
||||
if (top->GetSizer())
|
||||
top->GetSizer()->SetSizeHints(top);
|
||||
|
||||
// use SetClientSize() and not SetSize() otherwise the size for
|
||||
// e.g. a wxFrame with a menubar wouldn't be correctly set
|
||||
top->SetClientSize(sz);
|
||||
}
|
||||
}
|
||||
p->OnStateChange(sz);
|
||||
|
||||
if ( p->m_bIgnoreNextChange )
|
||||
{
|
||||
|
Reference in New Issue
Block a user