diff options
Diffstat (limited to 'views')
-rw-r--r-- | views/controls/button/custom_button.cc | 7 | ||||
-rw-r--r-- | views/controls/button/custom_button.h | 3 |
2 files changed, 10 insertions, 0 deletions
diff --git a/views/controls/button/custom_button.cc b/views/controls/button/custom_button.cc index 887e0b4..5f8e82e 100644 --- a/views/controls/button/custom_button.cc +++ b/views/controls/button/custom_button.cc @@ -52,6 +52,13 @@ void CustomButton::StartThrobbing(int cycles_til_stop) { hover_animation_->StartThrobbing(cycles_til_stop); } +void CustomButton::StopThrobbing() { + if (hover_animation_->is_animating()) { + hover_animation_->Stop(); + SchedulePaint(); + } +} + void CustomButton::SetAnimationDuration(int duration) { hover_animation_->SetSlideDuration(duration); } diff --git a/views/controls/button/custom_button.h b/views/controls/button/custom_button.h index b9e1d31..8b4008c 100644 --- a/views/controls/button/custom_button.h +++ b/views/controls/button/custom_button.h @@ -44,6 +44,9 @@ class CustomButton : public Button, // Starts throbbing. See HoverAnimation for a description of cycles_til_stop. void StartThrobbing(int cycles_til_stop); + // Stops throbbing immediately. + void StopThrobbing(); + // Set how long the hover animation will last for. void SetAnimationDuration(int duration); |