diff options
Diffstat (limited to 'views/controls/button/custom_button.cc')
-rw-r--r-- | views/controls/button/custom_button.cc | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/views/controls/button/custom_button.cc b/views/controls/button/custom_button.cc index 95ecb98..dab4e32 100644 --- a/views/controls/button/custom_button.cc +++ b/views/controls/button/custom_button.cc @@ -91,11 +91,11 @@ bool CustomButton::IsHotTracked() const { return state_ == BS_HOT; } -void CustomButton::SetEnabled(bool enabled) { - if (enabled ? (state_ != BS_DISABLED) : (state_ == BS_DISABLED)) +void CustomButton::OnEnabledChanged() { + if (View::IsEnabled() ? (state_ != BS_DISABLED) : (state_ == BS_DISABLED)) return; - if (enabled) + if (View::IsEnabled()) SetState(IsMouseHovered() ? BS_HOT : BS_NORMAL); else SetState(BS_DISABLED); @@ -196,7 +196,7 @@ bool CustomButton::OnKeyReleased(const KeyEvent& event) { } bool CustomButton::AcceleratorPressed(const Accelerator& accelerator) { - if (!enabled_) + if (!View::IsEnabled()) return false; SetState(BS_NORMAL); |