Commit db10c595 authored by Connie Wan's avatar Connie Wan Committed by Commit Bot

Polish TabGroupUnderline appearance on dragged tabs

This addresses #7 and #8 in the attached bug.

Here we selectively repaint only the necessary underline because otherwise there can be weird interactions where the dragged tabs appear underneath unassociated group underlines.

Bug: 1008438
Change-Id: I63038a958249800a2d3df97d8609b8dfe5963410
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1846045Reviewed-by: default avatarTaylor Bergquist <tbergquist@chromium.org>
Reviewed-by: default avatarCharlene Yan <cyan@chromium.org>
Commit-Queue: Connie Wan <connily@chromium.org>
Cr-Commit-Position: refs/heads/master@{#704219}
parent f0503a2f
...@@ -1915,6 +1915,15 @@ void TabStrip::PaintChildren(const views::PaintInfo& paint_info) { ...@@ -1915,6 +1915,15 @@ void TabStrip::PaintChildren(const views::PaintInfo& paint_info) {
for (size_t i = 0; i < tabs_dragging.size(); ++i) for (size_t i = 0; i < tabs_dragging.size(); ++i)
tabs_dragging[i]->Paint(paint_info); tabs_dragging[i]->Paint(paint_info);
// If dragging more than one grouped tab, paint the group underline above
// those tabs. Otherwise, the non-active tabs will not get an underline.
// All dragging tabs should belong to the same group, per TabDragController.
if (tabs_dragging.size() > 0) {
const base::Optional<TabGroupId> dragged_group = tabs_dragging[0]->group();
if (dragged_group.has_value())
group_underlines_[dragged_group.value()]->Paint(paint_info);
}
// If the active tab is being dragged, it goes last. // If the active tab is being dragged, it goes last.
if (active_tab && is_dragging) if (active_tab && is_dragging)
active_tab->Paint(paint_info); active_tab->Paint(paint_info);
......
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