diff --git a/src/common/sizer.cpp b/src/common/sizer.cpp index e121731de8..71ed6cb4b6 100644 --- a/src/common/sizer.cpp +++ b/src/common/sizer.cpp @@ -563,13 +563,10 @@ void wxSizer::DeleteWindows() wxSize wxSizer::Fit( wxWindow *window ) { - wxSize size; - if (window->IsTopLevel()) - size = FitSize( window ); - else - size = GetMinWindowSize( window ); + wxSize size(window->IsTopLevel() ? FitSize(window) + : GetMinWindowSize(window)); - window->SetSize( size ); + window->SetClientSize( size ); return size; }