diff options
author | Daniel Wilhelm <shieldwed@outlook.com> | 2019-12-14 15:52:53 +0000 |
---|---|---|
committer | Daniel Wilhelm <shieldwed@outlook.com> | 2019-12-14 15:52:53 +0000 |
commit | cc75e50ca861529d50601d247fd66f806fcb23a8 (patch) | |
tree | e2c5c7b1f98e64011b1ee8ca4e9bb9157510dfe7 /wx+/toggle_button.h | |
parent | Merge branch '10.17' into 'master' (diff) | |
parent | add upstream 10.18 (diff) | |
download | FreeFileSync-cc75e50ca861529d50601d247fd66f806fcb23a8.tar.gz FreeFileSync-cc75e50ca861529d50601d247fd66f806fcb23a8.tar.bz2 FreeFileSync-cc75e50ca861529d50601d247fd66f806fcb23a8.zip |
Merge branch '10.18' into 'master'10.18
add upstream 10.18
See merge request opensource-tracking/FreeFileSync!15
Diffstat (limited to 'wx+/toggle_button.h')
-rw-r--r-- | wx+/toggle_button.h | 25 |
1 files changed, 14 insertions, 11 deletions
diff --git a/wx+/toggle_button.h b/wx+/toggle_button.h index f61c3857..98ca32b3 100644 --- a/wx+/toggle_button.h +++ b/wx+/toggle_button.h @@ -28,8 +28,8 @@ public: SetLayoutDirection(wxLayout_LeftToRight); //avoid mirroring RTL languages like Hebrew or Arabic } - void init(const wxBitmap& activeBmp, - const wxBitmap& inactiveBmp); + void init(const wxBitmap& bmpActive, + const wxBitmap& bmpInactive); void setActive(bool value); bool isActive() const { return active_; } @@ -37,8 +37,8 @@ public: private: bool active_ = false; - wxBitmap activeBmp_; - wxBitmap inactiveBmp_; + wxBitmap bmpActive_; + wxBitmap bmpInactive_; }; @@ -49,21 +49,24 @@ private: //######################## implementation ######################## inline -void ToggleButton::init(const wxBitmap& activeBmp, - const wxBitmap& inactiveBmp) +void ToggleButton::init(const wxBitmap& bmpActive, + const wxBitmap& bmpInactive) { - activeBmp_ = activeBmp; - inactiveBmp_ = inactiveBmp; + bmpActive_ = bmpActive; + bmpInactive_ = bmpInactive; - setActive(active_); + setImage(*this, active_ ? bmpActive_ : bmpInactive_); } inline void ToggleButton::setActive(bool value) { - active_ = value; - setImage(*this, active_ ? activeBmp_ : inactiveBmp_); + if (active_ != value) + { + active_ = value; + setImage(*this, active_ ? bmpActive_ : bmpInactive_); + } } } |