summaryrefslogtreecommitdiff
path: root/wx+/bitmap_button.h
diff options
context:
space:
mode:
authorB. Stack <bgstack15@gmail.com>2023-05-19 09:24:58 -0400
committerB. Stack <bgstack15@gmail.com>2023-05-19 09:24:58 -0400
commit90bc692185a27f18acb6b029dfaf038e555ef8ff (patch)
treefdb56193bab28d36a4c6723bf847f3aa2ce36a9b /wx+/bitmap_button.h
parentadd upstream 12.2 (diff)
downloadFreeFileSync-90bc692185a27f18acb6b029dfaf038e555ef8ff.tar.gz
FreeFileSync-90bc692185a27f18acb6b029dfaf038e555ef8ff.tar.bz2
FreeFileSync-90bc692185a27f18acb6b029dfaf038e555ef8ff.zip
add upstream 12.312.3
Diffstat (limited to 'wx+/bitmap_button.h')
-rw-r--r--wx+/bitmap_button.h32
1 files changed, 13 insertions, 19 deletions
diff --git a/wx+/bitmap_button.h b/wx+/bitmap_button.h
index 70f161d2..188ee607 100644
--- a/wx+/bitmap_button.h
+++ b/wx+/bitmap_button.h
@@ -42,8 +42,10 @@ void setBitmapTextLabel(wxBitmapButton& btn, const wxImage& img, const wxString&
void setImage(wxAnyButton& button, const wxImage& bmp);
void setImage(wxStaticBitmap& staticBmp, const wxImage& img);
-wxBitmap renderSelectedButton(const wxSize& sz);
-wxBitmap renderPressedButton(const wxSize& sz);
+wxImage renderPressedButton(const wxSize& sz);
+
+inline wxColor getColorToggleButtonBorder(){ return {0x79, 0xbc, 0xed}; } //medium blue
+inline wxColor getColorToggleButtonFill (){ return {0xcc, 0xe4, 0xf8}; } //light blue
@@ -100,25 +102,14 @@ void setImage(wxStaticBitmap& staticBmp, const wxImage& img)
}
-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);
-
- const wxColor borderCol(0x79, 0xbc, 0xed); //medium blue
- const wxColor innerCol (0xcc, 0xe4, 0xf8); //light blue
- drawInsetRectangle(dc, wxRect(bmp.GetSize()), fastFromDIP(1), borderCol, innerCol);
- }
- return bmp;
-}
-
inline
-wxBitmap renderPressedButton(const wxSize& sz)
+wxImage generatePressedButtonBack(const wxSize& sz)
{
+#if 1
+ return rectangleImage(sz, wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW), {0x11, 0x79, 0xfe} /*light blue*/, fastFromDIP(2));
+
+#else //rectangle border with gradient as background
wxBitmap bmp(sz); //seems we don't need to pass 24-bit depth here even for high-contrast color schemes
bmp.SetScaleFactor(getDisplayScaleFactor());
{
@@ -145,7 +136,10 @@ wxBitmap renderPressedButton(const wxSize& sz)
dc.SetBrush(wxSystemSettings::GetColour(wxSYS_COLOUR_WINDOW));
dc.DrawRectangle(rect);
}
- return bmp;
+ wxImage img = bmp.ConvertToImage();
+ convertToVanillaImage(img);
+ return img;
+#endif
}
}
bgstack15