Index: ui/app_list/views/contents_view.cc |
diff --git a/ui/app_list/views/contents_view.cc b/ui/app_list/views/contents_view.cc |
index 19c9dd93836895343e2c8637f186e69053dbf31e..3c35593015f523e05b5268d59994bd749a20bcb3 100644 |
--- a/ui/app_list/views/contents_view.cc |
+++ b/ui/app_list/views/contents_view.cc |
@@ -203,20 +203,24 @@ void ContentsView::UpdatePageBounds() { |
} |
} |
- gfx::Rect incoming_target(rect); |
- gfx::Rect outgoing_target(rect); |
- int dir = target_page > current_page ? -1 : 1; |
- |
- // Pages transition vertically. |
+ // A page's origin is its off-screen resting place (top). The start page's |
+ // origin is above; all other pages' origins are below. |
+ int start_page = GetPageIndexForNamedPage(NAMED_PAGE_START); |
int page_height = rect.height(); |
- int transition_offset = progress * page_height * dir; |
- |
- outgoing_target.set_y(transition_offset); |
- incoming_target.set_y(dir < 0 ? transition_offset + page_height |
- : transition_offset - page_height); |
- |
- view_model_->view_at(current_page)->SetBoundsRect(outgoing_target); |
- view_model_->view_at(target_page)->SetBoundsRect(incoming_target); |
+ int current_page_origin = |
+ current_page == start_page ? -page_height : page_height; |
+ int target_page_origin = |
+ target_page == start_page ? -page_height : page_height; |
+ |
+ // Move |current_page| from 0 to its origin. Move |target_page| from its |
+ // origin to 0. |
+ gfx::Rect current_page_rect(rect); |
+ gfx::Rect target_page_rect(rect); |
+ current_page_rect.set_y(progress * current_page_origin); |
+ target_page_rect.set_y((1 - progress) * target_page_origin); |
+ |
+ view_model_->view_at(current_page)->SetBoundsRect(current_page_rect); |
+ view_model_->view_at(target_page)->SetBoundsRect(target_page_rect); |
calamity
2014/09/09 09:13:21
I think you need to do an IsExperimentalAppListEna
Matt Giuca
2014/09/10 01:45:36
Done.
Whoops.
|
} |
PaginationModel* ContentsView::GetAppsPaginationModel() { |