Commit 1dcc7f3c authored by Peter Boström's avatar Peter Boström Committed by Commit Bot

Update the tab-animation throbber style

Removes the round-rect end caps in favor of a rectangular throbber.

The throbber size and timings are also updated. See chromium:907435.

Bug: chromium:907422, chromium:907435
Change-Id: I7d7a18a4d19b18361db84de829a93475a57efa44
Reviewed-on: https://chromium-review.googlesource.com/c/1346091Reviewed-by: default avatarEdward Jung <edwardjung@chromium.org>
Reviewed-by: default avatarAvi Drissman <avi@chromium.org>
Commit-Queue: Peter Boström <pbos@chromium.org>
Cr-Commit-Position: refs/heads/master@{#610083}
parent 8fe64ac5
......@@ -276,7 +276,7 @@ void TabIcon::PaintLoadingProgressIndicator(gfx::Canvas* canvas,
(kProgressIndicatorAnimationDuration - 1.0)));
}
canvas->DrawRoundRect(bounds, bounds.height() / 2, flags);
canvas->DrawRect(bounds, flags);
}
void TabIcon::PaintLoadingAnimation(gfx::Canvas* canvas,
......
......@@ -193,10 +193,16 @@ GFX_EXPORT void PaintNewThrobberWaiting(Canvas* canvas,
float time = 2.0f * (elapsed_time.InMilliseconds() % kAnimationCycleMs) /
kAnimationCycleMs;
// 1 -> 2 values mirror back to 1 -> 0 values to represent right-to-left.
if (time > 1.0f)
const bool going_back = time > 1.0f;
if (going_back)
time = 2.0f - time;
// This animation should be fast in the middle and slow at the edges.
time = Tween::CalculateValue(Tween::EASE_IN_OUT, time);
const float min_width = throbber_container_bounds.height();
const float throbber_width = min_width * 2.5;
// The throbber animation stretches longer when moving in (left to right) than
// when going back.
const float throbber_width =
(going_back ? 0.75f : 1.0f) * throbber_container_bounds.width();
// These bounds keep at least |min_width| of the throbber visible (inside the
// throbber bounds).
......@@ -219,7 +225,7 @@ GFX_EXPORT void PaintNewThrobberWaiting(Canvas* canvas,
flags.setAntiAlias(true);
// Draw with circular end caps.
canvas->DrawRoundRect(bounds, bounds.height() / 2, flags);
canvas->DrawRect(bounds, flags);
}
} // namespace gfx
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment