Commit 05e6d611 authored by Weidong Guo's avatar Weidong Guo Committed by Commit Bot

Fix page slip issue after dragging

Changes:
Update the selected page to be the target page of dragged item at the
end of dragging.

Bug: 893832
Change-Id: I91dcf8e03f62eab1597e3899bdbcafdad1fec2df
Reviewed-on: https://chromium-review.googlesource.com/c/1324851
Commit-Queue: Weidong Guo <weidongg@chromium.org>
Reviewed-by: default avatarAlex Newcomer <newcomer@chromium.org>
Cr-Commit-Position: refs/heads/master@{#606585}
parent f8a077f1
...@@ -738,6 +738,13 @@ void AppsGridView::EndDrag(bool cancel) { ...@@ -738,6 +738,13 @@ void AppsGridView::EndDrag(bool cancel) {
drag_source_bounds); drag_source_bounds);
} }
if (!cancel) {
// Select the page where dragged item is dropped.
pagination_model_.SelectPage(
GetIndexFromModelIndex(GetModelIndexOfItem(drag_item)).page,
false /* animate */);
}
StopPageFlipTimer(); StopPageFlipTimer();
} }
...@@ -2199,9 +2206,6 @@ void AppsGridView::MoveItemInModel(AppListItemView* item_view, ...@@ -2199,9 +2206,6 @@ void AppsGridView::MoveItemInModel(AppListItemView* item_view,
view_model_.Move(current_model_index, target_model_index); view_model_.Move(current_model_index, target_model_index);
item_list_->AddObserver(this); item_list_->AddObserver(this);
if (pagination_model_.selected_page() != target.page)
pagination_model_.SelectPage(target.page, false);
RecordAppMovingTypeMetrics(folder_delegate_ ? kReorderInFolder RecordAppMovingTypeMetrics(folder_delegate_ ? kReorderInFolder
: kReorderInTopLevel); : kReorderInTopLevel);
} }
......
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