From 04a8e0e5bda4123e8c556551a1acc96bfcf32e84 Mon Sep 17 00:00:00 2001 From: Vadim Zeitlin Date: Sun, 17 Oct 2021 18:28:52 +0100 Subject: [PATCH] Use bitmap bundle rather than scaled bitmap size in wxToolBar Get the minimum size needed for the bitmaps from wxBitmapBundle. --- src/common/tbarbase.cpp | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/common/tbarbase.cpp b/src/common/tbarbase.cpp index 251600f652..9d2cbbbcbe 100644 --- a/src/common/tbarbase.cpp +++ b/src/common/tbarbase.cpp @@ -444,13 +444,14 @@ void wxToolBarBase::AdjustToolBitmapSize() wxSize sizeActual(sizeOrig); + const double scale = GetDPIScaleFactor(); for ( wxToolBarToolsList::const_iterator i = m_tools.begin(); i != m_tools.end(); ++i ) { - const wxBitmap& bmp = (*i)->GetNormalBitmap(); + const wxBitmapBundle& bmp = (*i)->GetNormalBitmapBundle(); if ( bmp.IsOk() ) - sizeActual.IncTo(bmp.GetScaledSize()); + sizeActual.IncTo(bmp.GetDefaultSize()*scale); } if ( sizeActual != sizeOrig )