summaryrefslogtreecommitdiff
path: root/wx+/bitmap_button.h
diff options
context:
space:
mode:
authorB. Stack <bgstack15@gmail.com>2022-06-26 16:00:37 +0000
committerB. Stack <bgstack15@gmail.com>2022-06-26 16:00:37 +0000
commit2a026bc7d76875b88700bebc7c5a801fef881bfd (patch)
treef820b53379f3d14e103e2663e8b0ecd38d1b2105 /wx+/bitmap_button.h
parentMerge branch 'b11.21' into 'master' (diff)
parentadd upstream 11.22 (diff)
downloadFreeFileSync-2a026bc7d76875b88700bebc7c5a801fef881bfd.tar.gz
FreeFileSync-2a026bc7d76875b88700bebc7c5a801fef881bfd.tar.bz2
FreeFileSync-2a026bc7d76875b88700bebc7c5a801fef881bfd.zip
Merge branch '11.22' into 'master'11.22
add upstream 11.22 See merge request opensource-tracking/FreeFileSync!45
Diffstat (limited to 'wx+/bitmap_button.h')
-rw-r--r--wx+/bitmap_button.h6
1 files changed, 4 insertions, 2 deletions
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 <wx/settings.h>
#include <wx/statbmp.h>
#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);
bgstack15