Fix wx issues from upgrade (#3032)
* fix top bar resizing * Attempt to fix bitmap bundle scaling issues * Revert "Attempt to fix bitmap bundle scaling issues" This reverts commit e94ba58d907b1b2da5a9e27ad552e1d7f1288c18. * Fix AboutDialog and partially fix SwitchButton * Fix switch button scaling on windows * Fix dropdown icon size * fixed sdcard/recording/timelapse icon size in device page * Set use_legacy_bmp to true by default to it's back compatible --------- Co-authored-by: Noisyfox <timemanager.rick@gmail.com> Co-authored-by: SoftFever <softfeverever@gmail.com>
This commit is contained in:
@@ -9,8 +9,8 @@
|
||||
|
||||
SwitchButton::SwitchButton(wxWindow* parent, wxWindowID id)
|
||||
: wxBitmapToggleButton(parent, id, wxNullBitmap, wxDefaultPosition, wxDefaultSize, wxBORDER_NONE | wxBU_EXACTFIT)
|
||||
, m_on(this, "toggle_on", 16, false, false, true)
|
||||
, m_off(this, "toggle_off", 16, false, false, true)
|
||||
, m_on(this, "toggle_on", {28, 16})
|
||||
, m_off(this, "toggle_off", {28, 16})
|
||||
, text_color(std::pair{0xfffffe, (int) StateColor::Checked}, std::pair{0x6B6B6B, (int) StateColor::Normal})
|
||||
, track_color(0xD9D9D9)
|
||||
, thumb_color(std::pair{0x009688, (int) StateColor::Checked}, std::pair{0xD9D9D9, (int) StateColor::Normal})
|
||||
@@ -101,7 +101,8 @@ void SwitchButton::Rescale()
|
||||
for (int i = 0; i < 2; ++i) {
|
||||
wxMemoryDC memdc(&dc);
|
||||
#ifdef __WXMSW__
|
||||
wxBitmap bmp(trackSize.x, trackSize.y);
|
||||
wxBitmap bmp;
|
||||
bmp.CreateWithDIPSize(ToDIP(trackSize), GetDPIScaleFactor());
|
||||
memdc.SelectObject(bmp);
|
||||
memdc.SetBackground(wxBrush(GetBackgroundColour()));
|
||||
memdc.Clear();
|
||||
@@ -145,4 +146,5 @@ void SwitchButton::Rescale()
|
||||
void SwitchButton::update()
|
||||
{
|
||||
SetBitmap((GetValue() ? m_on : m_off).bmp());
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user