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

Unified Diff: ui/app_list/cocoa/apps_collection_view_drag_manager.mm

Issue 14999013: Allow pages on the OSX app launcher to be turned while dragging. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: tests! Created 7 years, 7 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
Index: ui/app_list/cocoa/apps_collection_view_drag_manager.mm
diff --git a/ui/app_list/cocoa/apps_collection_view_drag_manager.mm b/ui/app_list/cocoa/apps_collection_view_drag_manager.mm
index ba5200f3016742105ff413ab06244780f63e6e61..42b955a18157731ef2b95084496d83c8d2e82433 100644
--- a/ui/app_list/cocoa/apps_collection_view_drag_manager.mm
+++ b/ui/app_list/cocoa/apps_collection_view_drag_manager.mm
@@ -145,7 +145,7 @@ const CGFloat kDragThreshold = 5;
if (!itemDragController_) {
itemDragController_.reset(
[[ItemDragController alloc] initWithGridCellSize:cellSize_]);
- [[gridController_ view] addSubview:[itemDragController_ view]];
+ [[[gridController_ view] superview] addSubview:[itemDragController_ view]];
}
[itemDragController_ initiate:[gridController_ itemAtIndex:itemHitIndex_]
@@ -160,6 +160,8 @@ const CGFloat kDragThreshold = 5;
- (void)updateDrag:(NSEvent*)theEvent {
[itemDragController_ update:[theEvent locationInWindow]
timestamp:[theEvent timestamp]];
+ [gridController_ maybeChangePageForPoint:[theEvent locationInWindow]];
+
size_t visiblePage = [gridController_ visiblePage];
size_t itemIndexOver = [self itemIndexForPage:visiblePage
hitWithEvent:theEvent];
@@ -195,6 +197,7 @@ const CGFloat kDragThreshold = 5;
- (void)completeDrag {
DCHECK_GE(itemDragIndex_, 0u);
+ [gridController_ cancelScrollTimer];
AppsGridViewItem* item = [gridController_ itemAtIndex:itemDragIndex_];
// The item could still be animating in the NSCollectionView, so ask it where
@@ -202,7 +205,7 @@ const CGFloat kDragThreshold = 5;
NSCollectionView* pageView = base::mac::ObjCCastStrict<NSCollectionView>(
[[item view] superview]);
size_t indexInPage = itemDragIndex_ % (rows_ * columns_);
- NSPoint targetOrigin = [[gridController_ view]
+ NSPoint targetOrigin = [[[itemDragController_ view] superview]
convertPoint:[pageView frameForItemAtIndex:indexInPage].origin
fromView:pageView];

Powered by Google App Engine
This is Rietveld 408576698