Chromium Code Reviews
chromiumcodereview-hr@appspot.gserviceaccount.com (chromiumcodereview-hr) | Please choose your nickname with Settings | Help | Chromium Project | Gerrit Changes | Sign out
(504)

Unified Diff: ash/wm/dock/docked_window_layout_manager.cc

Issue 82573002: Changes sequence of docked animations when evicting windows from dock. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Changes sequence of docked animations (added test) Created 7 years, 1 month ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | ash/wm/window_animations.cc » ('j') | ash/wm/window_animations_unittest.cc » ('J')
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ash/wm/dock/docked_window_layout_manager.cc
diff --git a/ash/wm/dock/docked_window_layout_manager.cc b/ash/wm/dock/docked_window_layout_manager.cc
index f4a2e2629b8225e442dd4d20bfe8a30714acf783..08990a093df8850dea2306d05b4ebd693b7813b2 100644
--- a/ash/wm/dock/docked_window_layout_manager.cc
+++ b/ash/wm/dock/docked_window_layout_manager.cc
@@ -45,7 +45,8 @@ const int DockedWindowLayoutManager::kMinDockGap = 2;
const int DockedWindowLayoutManager::kIdealWidth = 250;
const int kMinimumHeight = 250;
const int kSlideDurationMs = 120;
-const int kFadeDurationMs = 720;
+const int kFadeDurationMs = 60;
+const int kMinimizeDurationMs = 720;
namespace {
@@ -653,10 +654,17 @@ void DockedWindowLayoutManager::MaybeMinimizeChildrenExcept(
if (window == child || !IsUsedByLayout(window))
continue;
int room_needed = GetWindowHeightCloseTo(window, 0) + kMinDockGap;
- if (available_room > room_needed)
+ if (available_room > room_needed) {
available_room -= room_needed;
- else
+ } else {
+ // Slow down minimizing animations. Lock duration so that it is not
+ // overridden by other ScopedLayerAnimationSettings down the stack.
+ ui::ScopedLayerAnimationSettings settings(window->layer()->GetAnimator());
+ settings.SetTransitionDuration(
+ base::TimeDelta::FromMilliseconds(kMinimizeDurationMs));
+ settings.SetTransitionDurationLocked(true);
wm::GetWindowState(window)->Minimize();
+ }
}
}
@@ -673,7 +681,7 @@ void DockedWindowLayoutManager::RestoreDockedWindow(
wm::WindowState* window_state) {
aura::Window* window = window_state->window();
DCHECK(!IsPopupOrTransient(window));
- // Always place restored window at the top shuffling the other windows down.
+ // Always place restored window at the bottom shuffling the other windows up.
// TODO(varkha): add a separate container for docked windows to keep track
// of ordering.
gfx::Display display = Shell::GetScreen()->GetDisplayNearestWindow(
@@ -687,7 +695,7 @@ void DockedWindowLayoutManager::RestoreDockedWindow(
return;
}
gfx::Rect bounds(window->bounds());
- bounds.set_y(work_area.y() - bounds.height());
+ bounds.set_y(work_area.bottom());
window->SetBounds(bounds);
window->Show();
MaybeMinimizeChildrenExcept(window);
« no previous file with comments | « no previous file | ash/wm/window_animations.cc » ('j') | ash/wm/window_animations_unittest.cc » ('J')

Powered by Google App Engine
This is Rietveld 408576698