diff --git a/common/widgets/split_button.cpp b/common/widgets/split_button.cpp index 7c3e07d37a..b3f43a8a3b 100644 --- a/common/widgets/split_button.cpp +++ b/common/widgets/split_button.cpp @@ -39,10 +39,11 @@ SPLIT_BUTTON::SPLIT_BUTTON( wxWindow* aParent, wxWindowID aId, const wxString& a { if( aSize == wxDefaultSize ) { - wxSize defaultSize = wxButton::GetDefaultSize(); + wxSize defaultSize = wxButton::GetDefaultSize( aParent ); wxSize textSize = GetTextExtent( m_label ); - SetMinSize( wxSize( textSize.GetWidth(), defaultSize.GetHeight() + 1 ) ); + SetMinSize( wxSize( std::max( textSize.GetWidth(), defaultSize.GetWidth() + 1 ), + defaultSize.GetHeight() + 1 ) ); } Bind( wxEVT_PAINT, &SPLIT_BUTTON::OnPaint, this ); diff --git a/common/widgets/std_bitmap_button.cpp b/common/widgets/std_bitmap_button.cpp index 6c462bb0cf..f6b546321c 100644 --- a/common/widgets/std_bitmap_button.cpp +++ b/common/widgets/std_bitmap_button.cpp @@ -26,7 +26,6 @@ #include #include #include -#include #include #include #include @@ -40,7 +39,7 @@ STD_BITMAP_BUTTON::STD_BITMAP_BUTTON( wxWindow* aParent, wxWindowID aId, { if( aSize == wxDefaultSize ) { - wxSize defaultSize = wxButton::GetDefaultSize(); + wxSize defaultSize = wxButton::GetDefaultSize( aParent ); SetMinSize( wxSize( defaultSize.GetWidth() + 1, defaultSize.GetHeight() + 1 ) ); }