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

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

Issue 889403005: Make start page fill app list bounds. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@new_apps_grid_paddings
Patch Set: 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 | « ui/app_list/views/contents_animator.h ('k') | ui/app_list/views/contents_view.h » ('j') | 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 e6519808bfe3c697114ad23f1d51dc4d8d5cadc4..a060e09379b33cbbac1b7fc6914822bf1479d1d8 100644
--- a/ui/app_list/views/contents_animator.cc
+++ b/ui/app_list/views/contents_animator.cc
@@ -37,8 +37,9 @@ ContentsAnimator::~ContentsAnimator() {
}
gfx::Rect ContentsAnimator::GetOnscreenPageBounds(int page_index) const {
Matt Giuca 2015/02/09 03:51:14 I think it's better to simply move GetOnscreenPage
calamity 2015/02/09 05:25:14 SGTM. I'm going to move OffscreenBounds too.
- return contents_view_->GetPageIndexForState(
- AppListModel::STATE_CUSTOM_LAUNCHER_PAGE) == page_index
+ AppListModel::State state = contents_view_->GetStateForPageIndex(page_index);
+ return (state == AppListModel::STATE_CUSTOM_LAUNCHER_PAGE ||
+ state == AppListModel::STATE_START)
? contents_view_->GetContentsBounds()
: contents_view_->GetDefaultContentsBounds();
}
@@ -193,13 +194,14 @@ void StartToAppsAnimator::Update(double progress,
int apps_page) {
// TODO(mgiuca): This is just a clone of DefaultAnimator's animation. Write a
// custom animation for the All Apps button on the Start page.
- gfx::Rect on_screen(contents_view()->GetDefaultContentsBounds());
+ gfx::Rect from_page_onscreen(GetOnscreenPageBounds(start_page));
+ gfx::Rect to_page_onscreen(GetOnscreenPageBounds(apps_page));
gfx::Rect from_page_origin(GetOffscreenPageBounds(start_page));
gfx::Rect to_page_origin(GetOffscreenPageBounds(apps_page));
- gfx::Rect from_page_rect(
- gfx::Tween::RectValueBetween(progress, on_screen, from_page_origin));
+ gfx::Rect from_page_rect(gfx::Tween::RectValueBetween(
+ progress, from_page_onscreen, from_page_origin));
gfx::Rect to_page_rect(
- gfx::Tween::RectValueBetween(progress, to_page_origin, on_screen));
+ gfx::Tween::RectValueBetween(progress, to_page_origin, to_page_onscreen));
contents_view()->GetPageView(start_page)->SetBoundsRect(from_page_rect);
contents_view()->GetPageView(apps_page)->SetBoundsRect(to_page_rect);
« no previous file with comments | « ui/app_list/views/contents_animator.h ('k') | ui/app_list/views/contents_view.h » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698