summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--ash/frame/caption_buttons/frame_caption_button.cc13
1 files changed, 11 insertions, 2 deletions
diff --git a/ash/frame/caption_buttons/frame_caption_button.cc b/ash/frame/caption_buttons/frame_caption_button.cc
index 7845efe..2b16643 100644
--- a/ash/frame/caption_buttons/frame_caption_button.cc
+++ b/ash/frame/caption_buttons/frame_caption_button.cc
@@ -170,8 +170,17 @@ void FrameCaptionButton::OnGestureEvent(ui::GestureEvent* event) {
void FrameCaptionButton::PaintCentered(gfx::Canvas* canvas,
const gfx::ImageSkia& to_center,
int alpha) {
- if (!paint_as_active_)
- alpha *= kInactiveIconAlpha;
+ if (!paint_as_active_) {
+ // Paint icons as active when they are hovered over or pressed.
+ double inactive_alpha = kInactiveIconAlpha;
+ if (hover_animation_->is_animating()) {
+ inactive_alpha =
+ hover_animation_->CurrentValueBetween(inactive_alpha, 1.0f);
+ } else if (state() == STATE_PRESSED || state() == STATE_HOVERED) {
+ inactive_alpha = 1.0f;
+ }
+ alpha *= inactive_alpha;
+ }
SkPaint paint;
paint.setAlpha(alpha);