From bf12e8e99aecfc67701ba4fd1a486654bc9624a5 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Fri, 12 Nov 2021 17:54:02 +0000 Subject: [PATCH] Remove unnecessary wxToolbook::m_maxBitmapSize We don't need to keep track of the bitmap size and call SetToolBitmapSize() ourselves, wxToolBar should be (and is) able to do it on its own. --- include/wx/toolbook.h | 3 --- src/generic/toolbkg.cpp | 6 ------ 2 files changed, 9 deletions(-) diff --git a/include/wx/toolbook.h b/include/wx/toolbook.h index 365fed48f0..b75ee036e9 100644 --- a/include/wx/toolbook.h +++ b/include/wx/toolbook.h @@ -115,9 +115,6 @@ protected: // whether the toolbar needs to be realized bool m_needsRealizing; - // maximum bitmap size - wxSize m_maxBitmapSize; - private: // common part of all constructors void Init(); diff --git a/src/generic/toolbkg.cpp b/src/generic/toolbkg.cpp index 09ec9274f3..4cf5ba0739 100644 --- a/src/generic/toolbkg.cpp +++ b/src/generic/toolbkg.cpp @@ -200,8 +200,6 @@ void wxToolbook::Realize() { m_needsRealizing = false; - GetToolBar()->SetToolBitmapSize(m_maxBitmapSize); - GetToolBar()->Realize(); } @@ -289,11 +287,7 @@ bool wxToolbook::InsertPage(size_t n, bitmap.CopyFromIcon(icon); #endif - m_maxBitmapSize.x = wxMax(bitmap.GetWidth(), m_maxBitmapSize.x); - m_maxBitmapSize.y = wxMax(bitmap.GetHeight(), m_maxBitmapSize.y); - int toolId = page->GetId(); - GetToolBar()->SetToolBitmapSize(m_maxBitmapSize); GetToolBar()->InsertTool(n, toolId, text, bitmap, wxNullBitmap, wxITEM_RADIO); // fix current selection