From 03efe856012a55165542a3ac5c9055c25723f5e8 Mon Sep 17 00:00:00 2001 From: "B. Stack" Date: Sun, 26 Jun 2022 11:59:57 -0400 Subject: add upstream 11.22 --- wx+/bitmap_button.h | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'wx+/bitmap_button.h') diff --git a/wx+/bitmap_button.h b/wx+/bitmap_button.h index 32bc68c1..d701e64c 100644 --- a/wx+/bitmap_button.h +++ b/wx+/bitmap_button.h @@ -11,6 +11,7 @@ #include #include #include "image_tools.h" +#include "std_button_layout.h" #include "dc.h" @@ -66,9 +67,8 @@ void setBitmapTextLabel(wxBitmapButton& btn, const wxImage& img, const wxString& stackImages(imgTxt, img, ImageStackLayout::horizontal, ImageStackAlignment::center, gap); //SetMinSize() instead of SetSize() is needed here for wxWindows layout determination to work correctly - const int defaultHeight = wxButton::GetDefaultSize().GetHeight(); btn.SetMinSize({imgTxt.GetWidth () + 2 * border, - std::max(imgTxt.GetHeight() + 2 * border, defaultHeight)}); + std::max(imgTxt.GetHeight() + 2 * border, getDefaultButtonHeight())}); setImage(btn, imgTxt); } @@ -104,6 +104,7 @@ inline wxBitmap renderSelectedButton(const wxSize& sz) { wxBitmap bmp(sz); //seems we don't need to pass 24-bit depth here even for high-contrast color schemes + bmp.SetScaleFactor(getDisplayScaleFactor()); { wxMemoryDC dc(bmp); @@ -119,6 +120,7 @@ inline wxBitmap renderPressedButton(const wxSize& sz) { wxBitmap bmp(sz); //seems we don't need to pass 24-bit depth here even for high-contrast color schemes + bmp.SetScaleFactor(getDisplayScaleFactor()); { //draw rectangle border with gradient const wxColor colFrom = wxSystemSettings::GetColour(wxSYS_COLOUR_BTNFACE); -- cgit