diff --git a/docs/changes.txt b/docs/changes.txt index 1c5fc8e5f3..bc0609bfac 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -15,6 +15,7 @@ All (GUI): - added wxDialog::SetEscapeId() - wxItemContainerImmutable::FindString unified (affects wxRadioBox, wxListBox, wxComboBox and wxChoice) +- wxWindow::Fit() now works correctly for frames and dialogs too wxMSW: diff --git a/src/common/wincmn.cpp b/src/common/wincmn.cpp index 5e7143c74a..7a1e6e8577 100644 --- a/src/common/wincmn.cpp +++ b/src/common/wincmn.cpp @@ -528,9 +528,9 @@ void wxWindowBase::Centre(int direction) // fits the window around the children void wxWindowBase::Fit() { - if ( GetChildren().GetCount() > 0 ) + if ( !GetChildren().empty() ) { - SetSize(GetBestSize()); + SetClientSize(GetBestSize()); } //else: do nothing if we have no children }