Fix over scaled controls on windows (#13117)

init
This commit is contained in:
yw4z
2026-04-14 17:48:38 +03:00
committed by GitHub
parent 3e4af2c723
commit f02aa7200e
3 changed files with 47 additions and 6 deletions

View File

@@ -129,9 +129,10 @@ void BBLTopbarArt::DrawButton(wxDC& dc, wxWindow* wnd, const wxAuiToolBarItem& i
int bmpX = 0, bmpY = 0;
int textX = 0, textY = 0;
const wxBitmap& bmp = item.GetState() & wxAUI_BUTTON_STATE_DISABLED
? item.GetDisabledBitmap()
: item.GetBitmap();
// ORCA resolves the toolbar item bitmap using the actual window DPI context used for painting.
// GetBitmap() / GetDisabledBitmap() was using internal window pointer (m_window), not the paint-time wnd
// m_window was created before final DPI context was known so items not scales properly
const wxBitmap bmp = item.GetCurrentBitmapFor(wnd);
const wxSize bmpSize = bmp.IsOk() ? bmp.GetScaledSize() : wxSize(0, 0);