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:
parent
1d844882ed
commit
67739303fd
@ -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);
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user