Commit 0cedecd1 authored by Alex Newcomer's avatar Alex Newcomer Committed by Commit Bot

cros: Adjust hotseat and shelf animation durations

When the hotseat is enabled, animate the shelf and hotseat at the same
speed as the minimize/maximize animation.

Bug: 1028387
Change-Id: I5fae2038258b3353776bd283950509ec53d26e2a
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1935492Reviewed-by: default avatarAlex Newcomer <newcomer@chromium.org>
Reviewed-by: default avatarManu Cornet <manucornet@chromium.org>
Auto-Submit: Alex Newcomer <newcomer@chromium.org>
Commit-Queue: Manu Cornet <manucornet@chromium.org>
Cr-Commit-Position: refs/heads/master@{#718946}
parent 18d95b3e
...@@ -94,6 +94,9 @@ class ASH_EXPORT ShelfConfig : public TabletModeObserver, ...@@ -94,6 +94,9 @@ class ASH_EXPORT ShelfConfig : public TabletModeObserver,
// The duration of the hotseat background animations in ms. // The duration of the hotseat background animations in ms.
base::TimeDelta hotseat_background_animation_duration() const; base::TimeDelta hotseat_background_animation_duration() const;
// The duration of the shelf show/hide animation in ms.
base::TimeDelta shelf_animation_duration() const;
// The extra padding added to status area tray buttons on the shelf. // The extra padding added to status area tray buttons on the shelf.
int status_area_hit_region_padding() const; int status_area_hit_region_padding() const;
......
...@@ -182,7 +182,15 @@ int ShelfConfig::home_button_edge_spacing() const { ...@@ -182,7 +182,15 @@ int ShelfConfig::home_button_edge_spacing() const {
} }
base::TimeDelta ShelfConfig::hotseat_background_animation_duration() const { base::TimeDelta ShelfConfig::hotseat_background_animation_duration() const {
return base::TimeDelta::FromMilliseconds(350); // This matches the duration of the maximize/minimize animation.
return base::TimeDelta::FromMilliseconds(300);
}
base::TimeDelta ShelfConfig::shelf_animation_duration() const {
if (chromeos::switches::ShouldShowShelfHotseat())
return hotseat_background_animation_duration();
return base::TimeDelta::FromMilliseconds(200);
} }
int ShelfConfig::status_area_hit_region_padding() const { int ShelfConfig::status_area_hit_region_padding() const {
......
...@@ -91,9 +91,6 @@ constexpr float kDefaultShelfOpacity = 1.0f; ...@@ -91,9 +91,6 @@ constexpr float kDefaultShelfOpacity = 1.0f;
// Delay before showing the shelf. This is after the mouse stops moving. // Delay before showing the shelf. This is after the mouse stops moving.
constexpr int kAutoHideDelayMS = 200; constexpr int kAutoHideDelayMS = 200;
// Duration of the animation to show or hide the shelf.
constexpr int kAnimationDurationMS = 200;
// To avoid hiding the shelf when the mouse transitions from a message bubble // To avoid hiding the shelf when the mouse transitions from a message bubble
// into the shelf, the hit test area is enlarged by this amount of pixels to // into the shelf, the hit test area is enlarged by this amount of pixels to
// keep the shelf from hiding. // keep the shelf from hiding.
...@@ -1395,7 +1392,7 @@ void ShelfLayoutManager::UpdateBoundsAndOpacity( ...@@ -1395,7 +1392,7 @@ void ShelfLayoutManager::UpdateBoundsAndOpacity(
shelf_animation_setter.AddObserver(hide_animation_observer_.get()); shelf_animation_setter.AddObserver(hide_animation_observer_.get());
if (animate) { if (animate) {
auto duration = base::TimeDelta::FromMilliseconds(kAnimationDurationMS); auto duration = ShelfConfig::Get()->shelf_animation_duration();
shelf_animation_setter.SetTransitionDuration(duration); shelf_animation_setter.SetTransitionDuration(duration);
shelf_animation_setter.SetTweenType(gfx::Tween::EASE_OUT); shelf_animation_setter.SetTweenType(gfx::Tween::EASE_OUT);
shelf_animation_setter.SetPreemptionStrategy( shelf_animation_setter.SetPreemptionStrategy(
......
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