diff --git a/docs/changes.txt b/docs/changes.txt index 45e4732d13..1cadd65f1a 100644 --- a/docs/changes.txt +++ b/docs/changes.txt @@ -262,6 +262,7 @@ All (GUI): - Improve month selection in wxGenericCalendarCtrl (Lauri Nurmi, #22853). - Fix maximum length of wxPropertyGrid editors (#23033). - Add support for Caps/Num/Scroll Lock to wxGetKeyState() (elfmz, #23195). +- Fix wxToolBar::GetToolBitmapSize() in high DPI under non-MSW (#23222). wxGTK: diff --git a/interface/wx/toolbar.h b/interface/wx/toolbar.h index eda0697bd8..c3865fad99 100644 --- a/interface/wx/toolbar.h +++ b/interface/wx/toolbar.h @@ -594,6 +594,11 @@ public: usually unnecessary to call either this function or SetToolBitmapSize() at all. + This function returns the size in logical pixels, for consistency with + SetToolBitmapSize() which takes size in logical pixels. See @ref + overview_high_dpi for more information about the different pixel types + and how to convert between them. + @remarks Note that this is the size of the bitmap you pass to AddTool(), and not the eventual size of the tool button. diff --git a/src/common/tbarbase.cpp b/src/common/tbarbase.cpp index 72b022812c..bc744e8e37 100644 --- a/src/common/tbarbase.cpp +++ b/src/common/tbarbase.cpp @@ -489,7 +489,7 @@ void wxToolBarBase::AdjustToolBitmapSize() // We want to round 1.5 down to 1, but 1.75 up to 2. int scaleFactorRoundedDown = static_cast(ceil(2*GetDPIScaleFactor())) / 2; - sizeNeeded = m_requestedBitmapSize*scaleFactorRoundedDown; + sizeNeeded = FromPhys(m_requestedBitmapSize*scaleFactorRoundedDown); } else // Determine the best size to use from the bitmaps we have. {