diff options
author | Daniel Wilhelm <shieldwed@outlook.com> | 2019-01-16 00:44:17 +0000 |
---|---|---|
committer | Daniel Wilhelm <shieldwed@outlook.com> | 2019-01-16 00:44:17 +0000 |
commit | c03ea582bff36fe020af1aa329b34f3e6d580f92 (patch) | |
tree | 41b8a3085df4de883f2993773b138f1436e041a4 /wx+/bitmap_button.h | |
parent | Merge branch '10.7' into 'master' (diff) | |
parent | 10.8 (diff) | |
download | FreeFileSync-c03ea582bff36fe020af1aa329b34f3e6d580f92.tar.gz FreeFileSync-c03ea582bff36fe020af1aa329b34f3e6d580f92.tar.bz2 FreeFileSync-c03ea582bff36fe020af1aa329b34f3e6d580f92.zip |
Merge branch '10.8' into 'master'10.8
10.8
See merge request opensource-tracking/FreeFileSync!5
Diffstat (limited to 'wx+/bitmap_button.h')
-rwxr-xr-x | wx+/bitmap_button.h | 10 |
1 files changed, 4 insertions, 6 deletions
diff --git a/wx+/bitmap_button.h b/wx+/bitmap_button.h index dc7615c1..738a62ff 100755 --- a/wx+/bitmap_button.h +++ b/wx+/bitmap_button.h @@ -29,6 +29,7 @@ public: wxBitmapButton(parent, id, wxNullBitmap, pos, size, style | wxBU_AUTODRAW, validator, name) { SetLabel(label); } }; +//wxButton::SetBitmap() also supports "image + text", but screws up proper gap and border handling void setBitmapTextLabel(wxBitmapButton& btn, const wxImage& img, const wxString& text, int gap = fastFromDIP(5), int border = fastFromDIP(5)); //set bitmap label flicker free: @@ -54,12 +55,9 @@ void setBitmapTextLabel(wxBitmapButton& btn, const wxImage& img, const wxString& wxImage dynImage = createImageFromText(text, btn.GetFont(), btn.GetForegroundColour()); if (img.IsOk()) - { - if (btn.GetLayoutDirection() != wxLayout_RightToLeft) - dynImage = stackImages(img, dynImage, ImageStackLayout::HORIZONTAL, ImageStackAlignment::CENTER, gap); - else - dynImage = stackImages(dynImage, img, ImageStackLayout::HORIZONTAL, ImageStackAlignment::CENTER, gap); - } + dynImage = btn.GetLayoutDirection() != wxLayout_RightToLeft ? + stackImages(img, dynImage, ImageStackLayout::HORIZONTAL, ImageStackAlignment::CENTER, gap) : + stackImages(dynImage, img, ImageStackLayout::HORIZONTAL, ImageStackAlignment::CENTER, gap); //SetMinSize() instead of SetSize() is needed here for wxWindows layout determination to work corretly const int defaultHeight = wxButton::GetDefaultSize().GetHeight(); |