Use control current, not best, size in wxMSW wxToolBar layout code

Avoid allocating too much space to the control in the toolbar, it may
have been made smaller than its best size on purpose and, in any case,
we don't resize the control, so it's useless to allocate more space to
it than it's going to use.

See #18294.
This commit is contained in:
Vadim Zeitlin
2019-03-31 13:39:57 +02:00
parent 58d4b0e209
commit b0ad9ccffd
2 changed files with 5 additions and 2 deletions

View File

@@ -443,7 +443,7 @@ void MyFrame::PopulateToolbar(wxToolBarBase* toolBar)
wxComboBox *combo = new wxComboBox(toolBar, ID_COMBO, wxEmptyString, wxDefaultPosition, wxSize(100,-1) );
combo->Append("This");
combo->Append("is a");
combo->Append("combobox");
combo->Append("combobox with extremely, extremely, extremely, extremely long label");
combo->Append("in a");
combo->Append("toolbar");
toolBar->AddControl(combo, "Combo Label");