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

Issue 338263002: Change how the insertion point for tab drags is calculated. (Closed)

Created:
6 years, 6 months ago by Peter Kasting
Modified:
6 years, 6 months ago
Reviewers:
sky
CC:
chromium-reviews, tfarina, dcheng
Visibility:
Public.

Description

Change how the insertion point for tab drags is calculated. Previously, we would use the X-coordinate of the left edge of the dragged tabs, and check whether it fell within the left or right half of each tab in the strip. This had a couple problems. First, because tabs are wider than they appear (due to a significant portion of the tab being the outside pieces that are flush or nearly-flush with the top of the toolbar), the true left edge of the dragged region is "to the left of" where the user thinks the drag point ought to be, and this discrepancy becomes noticeable as tabs get narrow, with the insertion sometimes seeming to happen a tab to the left of where it "ought to". Instead, we now use a (hardcoded) 16-px offset into the drag region, which is much closer to where the user perceives the "start" of the region to be. Second, again because tabs are wider than they appear, the right half of one tab can overlap with the next tab, indeed sometimes even overlapping with the right half of that next tab, so the insertion point can be calculated in a way that appears to be off by a tab or so. Instead, we now simply use the regions between successive tab midpoints to calculate the desired insertion index. The result of this is that the apparent "slop zone" between tabs gets slightly larger, and it takes a slightly further drag to drag to the very beginning of the tabstrip; but most noticeably, when dragging tabs that are very narrow (e.g. in tabstrip overflow), dragging feels much more predictable and less like the instant you grab a set of tabs, they get moved to somewhere strange. BUG=none TEST=none R=sky@chromium.org Committed: https://src.chromium.org/viewvc/chrome?view=rev&revision=277801

Patch Set 1 #

Unified diffs Side-by-side diffs Delta from patch set Stats (+62 lines, -22 lines) Patch
M chrome/browser/ui/views/tabs/tab.h View 1 chunk +11 lines, -0 lines 0 comments Download
M chrome/browser/ui/views/tabs/tab_drag_controller.h View 1 chunk +8 lines, -5 lines 0 comments Download
M chrome/browser/ui/views/tabs/tab_drag_controller.cc View 6 chunks +43 lines, -17 lines 0 comments Download

Messages

Total messages: 3 (0 generated)
Peter Kasting
6 years, 6 months ago (2014-06-17 01:55:55 UTC) #1
sky
LGTM
6 years, 6 months ago (2014-06-17 15:16:19 UTC) #2
Peter Kasting
6 years, 6 months ago (2014-06-17 18:07:28 UTC) #3
Message was sent while issue was closed.
Committed patchset #1 manually as r277801 (presubmit successful).

Powered by Google App Engine
This is Rietveld 408576698