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

Unified Diff: chrome/browser/ui/cocoa/tabs/tab_strip_drag_controller.mm

Issue 2541653002: Add a dead zone when dragging tabs horizontally on Mac (Closed)
Patch Set: Created 4 years, 1 month 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 | « chrome/browser/ui/cocoa/tabs/tab_strip_drag_controller.h ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/tabs/tab_strip_drag_controller.mm
diff --git a/chrome/browser/ui/cocoa/tabs/tab_strip_drag_controller.mm b/chrome/browser/ui/cocoa/tabs/tab_strip_drag_controller.mm
index 3d168310cbb5820ab90d3ccf9d4b9e060d6e76ba..7fef8ad35fb6ea13a0b7af1092b1c05469910489 100644
--- a/chrome/browser/ui/cocoa/tabs/tab_strip_drag_controller.mm
+++ b/chrome/browser/ui/cocoa/tabs/tab_strip_drag_controller.mm
@@ -171,6 +171,12 @@ static BOOL PointIsInsideView(NSPoint screenPoint, NSView* view) {
if (draggingWithinTabStrip_) {
NSPoint thisPoint = [NSEvent mouseLocation];
CGFloat offset = thisPoint.x - dragOrigin_.x;
+ // Only begin dragging the tab horizontally if it's torn out of its dead
+ // zone.
+ if (!outOfTabHorizontalDeadZone_ && fabs(offset) > kTearDistance) {
Avi (use Gerrit) 2016/11/30 00:01:22 Do we want kTearDistance? That's 36 pixels, and wh
erikchen 2016/11/30 15:05:16 Agreed that this should be significantly smaller.
njagsarran 2016/11/30 17:44:49 Looks like Views uses 10, what do you guys think o
njagsarran 2016/11/30 20:26:32 Done.
+ outOfTabHorizontalDeadZone_ = YES;
+ }
+ if (outOfTabHorizontalDeadZone_)
Avi (use Gerrit) 2016/11/30 00:01:22 You'd need to adjust the indentation here with a n
njagsarran 2016/11/30 20:26:32 Done.
[sourceController_ insertPlaceholderForTab:[draggedTab_ tabView]
frame:NSOffsetRect(sourceTabFrame_,
offset, 0)];
@@ -429,6 +435,7 @@ static BOOL PointIsInsideView(NSPoint screenPoint, NSView* view) {
TabWindowController* dropController = sourceController_;
[dropController moveTabViews:@[ [dropController activeTabView] ]
fromController:nil];
+ outOfTabHorizontalDeadZone_ = NO;
erikchen 2016/11/30 15:05:16 presumably we always want to reset this when the d
njagsarran 2016/11/30 20:26:32 Done.
}
} else if (targetController_) {
// Move between windows. If |targetController_| is nil, we're not dropping
« no previous file with comments | « chrome/browser/ui/cocoa/tabs/tab_strip_drag_controller.h ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698