X-Git-Url: https://git.saurik.com/wxWidgets.git/blobdiff_plain/550d433e523dc462c62a2346c0fd713a1d5705e8..a97d569cbbf90ba8bb293214055c3a8c19d447b5:/src/gtk/collpane.cpp?ds=sidebyside diff --git a/src/gtk/collpane.cpp b/src/gtk/collpane.cpp index ced9096279..edd737d066 100644 --- a/src/gtk/collpane.cpp +++ b/src/gtk/collpane.cpp @@ -20,9 +20,9 @@ #ifdef __WXGTK24__ #include "wx/collpane.h" +#include "wx/gtk/private.h" #include -#include const wxChar wxCollapsiblePaneNameStr[] = wxT("CollapsiblePane"); @@ -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 = p->GetTopLevelParent(); - 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 ) { @@ -158,7 +132,8 @@ bool wxCollapsiblePane::Create(wxWindow *parent, return false; } - m_widget = gtk_expander_new(label.c_str()); + m_widget = + gtk_expander_new_with_mnemonic(wxGTK_CONV(GTKConvertMnemonics(label))); // see the gtk_collapsiblepane_expanded_callback comments to understand why // we connect to the "notify::expanded" signal instead of the more common