Remove unnecessary wxSizer::Fit() calls

wxSizer::SetSizeHints() already does what Fit() does (while also setting
the minimum window size to the fitting size), so there is no need to
call both of them.

No real changes, just some cleanup.
This commit is contained in:
Vadim Zeitlin
2022-02-19 15:38:07 +01:00
parent fab42c3e2c
commit 61d10a7328
11 changed files with 0 additions and 11 deletions

View File

@@ -372,7 +372,6 @@ bool wxAnyChoiceDialog::Create(wxWindow *parent,
SetSizer( topsizer );
topsizer->SetSizeHints( this );
topsizer->Fit( this );
if ( styleDlg & wxCENTRE )
Centre(wxBOTH);

View File

@@ -395,7 +395,6 @@ void wxGenericColourDialog::CreateWidgets()
SetSizer( topSizer );
topSizer->SetSizeHints( this );
topSizer->Fit( this );
Centre( wxBOTH );
}

View File

@@ -160,7 +160,6 @@ bool wxGenericDirDialog::Create(wxWindow* parent,
SetSizer( topsizer );
topsizer->SetSizeHints( this );
topsizer->Fit( this );
Centre( wxBOTH );

View File

@@ -207,7 +207,6 @@ bool wxGenericFindReplaceDialog::Create(wxWindow *parent,
SetSizer( topsizer );
topsizer->SetSizeHints( this );
topsizer->Fit( this );
Centre( wxBOTH );

View File

@@ -513,7 +513,6 @@ void wxGenericFontDialog::CreateWidgets()
GetSizer()->SetItemMinSize(m_previewer, is_pda ? 100 : 430, is_pda ? 40 : 100);
GetSizer()->SetSizeHints(this);
GetSizer()->Fit(this);
Centre(wxBOTH);

View File

@@ -220,7 +220,6 @@ void wxGenericMessageDialog::DoCreateMsgdialog()
SetSizer( topsizer );
topsizer->SetSizeHints( this );
topsizer->Fit( this );
wxSize size( GetSize() );
if (size.x < size.y*3/2)
{

View File

@@ -123,7 +123,6 @@ bool wxNumberEntryDialog::Create(wxWindow *parent,
SetSizer( topsizer );
topsizer->SetSizeHints( this );
topsizer->Fit( this );
Centre( wxBOTH );

View File

@@ -88,7 +88,6 @@ void wxPropertySheetDialog::Init()
// Layout the dialog, to be called after pages have been created
void wxPropertySheetDialog::LayoutDialog(int centreFlags)
{
GetSizer()->Fit(this);
GetSizer()->SetSizeHints(this);
if (centreFlags)
Centre(centreFlags);

View File

@@ -114,7 +114,6 @@ bool wxTextEntryDialog::Create(wxWindow *parent,
SetSizer( topsizer );
topsizer->SetSizeHints( this );
topsizer->Fit( this );
if ( style & wxCENTRE )
Centre( wxBOTH );

View File

@@ -272,7 +272,6 @@ wxTipDialog::wxTipDialog(wxWindow *parent,
SetSizer( topsizer );
topsizer->SetSizeHints( this );
topsizer->Fit( this );
Centre(wxBOTH | wxCENTER_FRAME);
}

View File

@@ -297,7 +297,6 @@ bool wxFontDialog::Create(wxWindow* parent, const wxFontData& fontData)
wxDialog::Create( parent, wxID_ANY, caption, wxDefaultPosition, wxDefaultSize, wxDEFAULT_DIALOG_STYLE|wxRESIZE_BORDER );
CreateControls();
GetSizer()->Fit(this);
GetSizer()->SetSizeHints(this);
Centre();