From 2a5903cd9b0992f763e87ace9c73d7f9c255840b Mon Sep 17 00:00:00 2001 From: Alex Shvartzkop Date: Sun, 26 May 2024 22:14:52 +0300 Subject: [PATCH] More universal way of scaling indicator icon bitmaps. --- common/widgets/indicator_icon.cpp | 7 +------ include/widgets/ui_common.h | 6 +----- 2 files changed, 2 insertions(+), 11 deletions(-) diff --git a/common/widgets/indicator_icon.cpp b/common/widgets/indicator_icon.cpp index fb8625e596..0d443ca70c 100644 --- a/common/widgets/indicator_icon.cpp +++ b/common/widgets/indicator_icon.cpp @@ -39,7 +39,7 @@ INDICATOR_ICON::INDICATOR_ICON( wxWindow* aParent, ICON_PROVIDER& aIconProvider, const wxBitmap& icon = m_iconProvider.GetIndicatorIcon( m_currentId ); - m_bitmap = new wxStaticBitmap( this, aID, icon, wxDefaultPosition, icon.GetSize() ); + m_bitmap = new wxStaticBitmap( this, aID, icon, wxDefaultPosition, icon.GetLogicalSize() ); sizer->Add( m_bitmap, 0, 0 ); @@ -175,11 +175,6 @@ ROW_ICON_PROVIDER::ROW_ICON_PROVIDER( int aSizeDIP, wxWindow* aWindow ) double scale = aWindow->GetDPIScaleFactor(); wxColour shadowColor = wxSystemSettings().GetColour( wxSYS_COLOUR_3DDKSHADOW ); -#ifdef __WXMAC__ - // Adjust for Retina - scale /= KIPLATFORM::UI::GetPixelScaleFactor( aWindow ); -#endif - m_blankBitmap = wxBitmap( createBlankImage( toPhys( aSizeDIP ) ) ); m_blankBitmap.SetScaleFactor( scale ); diff --git a/include/widgets/ui_common.h b/include/widgets/ui_common.h index 119c054561..d27da611ce 100644 --- a/include/widgets/ui_common.h +++ b/include/widgets/ui_common.h @@ -48,11 +48,7 @@ class wxMenu; namespace KIUI { -#ifdef __WXMAC__ - const int c_IndicatorSizeDIP = 6; -#else - const int c_IndicatorSizeDIP = 10; -#endif +const int c_IndicatorSizeDIP = 10; /**