diff options
author | B. Stack <bgstack15@gmail.com> | 2022-08-03 12:51:45 +0000 |
---|---|---|
committer | B. Stack <bgstack15@gmail.com> | 2022-08-03 12:51:45 +0000 |
commit | 3f91181f8458cb6a6d95e25123db874875f7b259 (patch) | |
tree | c36c0f0c5fab7aa60432e9e1d32ba5fdfabeb55e /wx+ | |
parent | Merge branch '11.22' into 'master' (diff) | |
parent | add upstream 11.23 (diff) | |
download | FreeFileSync-3f91181f8458cb6a6d95e25123db874875f7b259.tar.gz FreeFileSync-3f91181f8458cb6a6d95e25123db874875f7b259.tar.bz2 FreeFileSync-3f91181f8458cb6a6d95e25123db874875f7b259.zip |
Merge branch 'b11.23' into 'master'11.23
add upstream 11.23
See merge request opensource-tracking/FreeFileSync!46
Diffstat (limited to 'wx+')
-rw-r--r-- | wx+/bitmap_button.h | 6 | ||||
-rw-r--r-- | wx+/context_menu.h | 2 | ||||
-rw-r--r-- | wx+/dc.h | 6 | ||||
-rw-r--r-- | wx+/rtl.h | 3 |
4 files changed, 9 insertions, 8 deletions
diff --git a/wx+/bitmap_button.h b/wx+/bitmap_button.h index d701e64c..70f161d2 100644 --- a/wx+/bitmap_button.h +++ b/wx+/bitmap_button.h @@ -85,18 +85,18 @@ void setImage(wxAnyButton& button, const wxImage& img) } - button.SetBitmapLabel(toBitmapBundle(img)); + button.SetBitmapLabel(toScaledBitmap(img)); //wxWidgets excels at screwing up consistently once again: //the first call to SetBitmapLabel() *implicitly* sets the disabled bitmap, too, subsequent calls, DON'T! - button.SetBitmapDisabled(toBitmapBundle(img.ConvertToDisabled())); //inefficiency: wxBitmap::ConvertToDisabled() implicitly converts to wxImage! + button.SetBitmapDisabled(toScaledBitmap(img.ConvertToDisabled())); //inefficiency: wxBitmap::ConvertToDisabled() implicitly converts to wxImage! } inline void setImage(wxStaticBitmap& staticBmp, const wxImage& img) { - staticBmp.SetBitmap(toBitmapBundle(img)); + staticBmp.SetBitmap(toScaledBitmap(img)); } diff --git a/wx+/context_menu.h b/wx+/context_menu.h index ef11e37b..05dd58b8 100644 --- a/wx+/context_menu.h +++ b/wx+/context_menu.h @@ -28,7 +28,7 @@ namespace zen inline void setImage(wxMenuItem& menuItem, const wxImage& img) { - menuItem.SetBitmap(toBitmapBundle(img)); + menuItem.SetBitmap(toScaledBitmap(img)); } @@ -126,12 +126,12 @@ int getDpiScalePercent() inline -wxBitmapBundle toBitmapBundle(const wxImage& img /*expected to be DPI-scaled!*/) +wxBitmap toScaledBitmap(const wxImage& img /*expected to be DPI-scaled!*/) { - //return wxBitmap(img, -1 /*depth*/, static_cast<double>(getDPI()) / defaultDpi); implementation just ignores scale parameter! WTF! + //wxBitmap(const wxImage& image, int depth = -1, double WXUNUSED(scale) = 1.0) => wxWidgets just ignores scale parameter! WTF! wxBitmap bmpScaled(img); bmpScaled.SetScaleFactor(getDisplayScaleFactor()); - return bmpScaled; + return bmpScaled; //when testing use 175% scaling: wxWidgets' scaling logic doesn't kick in for 150% only } @@ -10,6 +10,7 @@ #include <wx/dcmemory.h> #include <wx/image.h> #include <wx/app.h> +#include "dc.h" namespace zen @@ -50,7 +51,7 @@ void drawBitmapAligned(wxDC& dc, const wxImage& img, const wxRect& rect, int ali else if (alignment & wxALIGN_CENTER_VERTICAL) pt.y += (rect.height - img.GetHeight()) / 2; - dc.DrawBitmap(img, pt); + dc.DrawBitmap(toScaledBitmap(img), pt); } } |