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

Unified Diff: ui/app_list/views/contents_animator.cc

Issue 901133003: Fix janky experimental app list animation. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@search_box_with_shadow
Patch Set: make animation have same velocity in both directions Created 5 years, 10 months 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 | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: ui/app_list/views/contents_animator.cc
diff --git a/ui/app_list/views/contents_animator.cc b/ui/app_list/views/contents_animator.cc
index 97d3c502820be5f605ce80c6040ff2496311c581..feb97980ccda595fc0dd74cb2b81838d117d4953 100644
--- a/ui/app_list/views/contents_animator.cc
+++ b/ui/app_list/views/contents_animator.cc
@@ -27,21 +27,23 @@ ContentsAnimator::~ContentsAnimator() {
}
gfx::Rect ContentsAnimator::GetOnscreenPageBounds(int page_index) const {
- return contents_view_->IsStateActive(AppListModel::STATE_CUSTOM_LAUNCHER_PAGE)
+ return contents_view_->GetPageIndexForState(
+ AppListModel::STATE_CUSTOM_LAUNCHER_PAGE) == page_index
? contents_view_->GetContentsBounds()
: contents_view_->GetDefaultContentsBounds();
}
gfx::Rect ContentsAnimator::GetOffscreenPageBounds(int page_index) const {
- gfx::Rect bounds(contents_view_->GetContentsBounds());
+ gfx::Rect bounds(GetOnscreenPageBounds(page_index));
// The start page and search page origins are above; all other pages' origins
// are below.
- int page_height = bounds.height();
bool origin_above = contents_view_->GetPageIndexForState(
AppListModel::STATE_START) == page_index ||
contents_view_->GetPageIndexForState(
AppListModel::STATE_SEARCH_RESULTS) == page_index;
- bounds.set_y(origin_above ? -page_height : page_height);
+ bounds.set_y(origin_above
+ ? -bounds.height()
+ : contents_view_->GetContentsBounds().height() + bounds.y());
return bounds;
}
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698