Don't force wxAuiToolBar size to be less than its parent

This results in the toolbar being too small to show any items in it
in wxGTK and wxOSX, because the parent window size is still the default
small one and not the actual size it will be when shown, when the size
of the toolbar is first set.

And it seems completely unnecessary to do this anyhow, as toolbar is
resized by wxAuiManager in any case.

Closes #18218.
This commit is contained in:
Vadim Zeitlin 2019-10-27 17:41:05 +01:00
parent 1d844882ed
commit 67739303fd
2 changed files with 0 additions and 22 deletions

View File

@ -618,12 +618,6 @@ protected:
wxSize GetLabelSize(const wxString& label);
wxAuiToolBarItem* FindToolByPositionWithPacking(wxCoord x, wxCoord y) const;
void DoSetSize(int x,
int y,
int width,
int height,
int sizeFlags = wxSIZE_AUTO) wxOVERRIDE;
protected: // handlers
void OnSize(wxSizeEvent& evt);

View File

@ -2326,22 +2326,6 @@ void wxAuiToolBar::OnSize(wxSizeEvent& WXUNUSED(evt))
void wxAuiToolBar::DoSetSize(int x,
int y,
int width,
int height,
int sizeFlags)
{
wxSize parent_size = GetParent()->GetClientSize();
if (x + width > parent_size.x)
width = wxMax(0, parent_size.x - x);
if (y + height > parent_size.y)
height = wxMax(0, parent_size.y - y);
wxWindow::DoSetSize(x, y, width, height, sizeFlags);
}
void wxAuiToolBar::OnIdle(wxIdleEvent& evt)
{
// if orientation doesn't match dock, fix it