From 67739303fd1b089af1811c0ed09f02d2d734bc55 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 27 Oct 2019 17:41:05 +0100 Subject: [PATCH] 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. --- include/wx/aui/auibar.h | 6 ------ src/aui/auibar.cpp | 16 ---------------- 2 files changed, 22 deletions(-) diff --git a/include/wx/aui/auibar.h b/include/wx/aui/auibar.h index 8fdcfce4e2..05b841983a 100644 --- a/include/wx/aui/auibar.h +++ b/include/wx/aui/auibar.h @@ -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); diff --git a/src/aui/auibar.cpp b/src/aui/auibar.cpp index 742c8e200f..4b6f3379c0 100644 --- a/src/aui/auibar.cpp +++ b/src/aui/auibar.cpp @@ -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