Commit 28beb983 authored by Caroline Rising's avatar Caroline Rising Committed by Commit Bot

Inset anchor rect for tab hover cards.

Bug: 910739
Change-Id: I25bf423759ac715279954cc4a24023ae808404fe
Reviewed-on: https://chromium-review.googlesource.com/c/chromium/src/+/1600455
Commit-Queue: Caroline Rising <corising@chromium.org>
Reviewed-by: default avatarDana Fried <dfried@chromium.org>
Cr-Commit-Position: refs/heads/master@{#657523}
parent 725e5486
...@@ -211,6 +211,7 @@ class TabHoverCardBubbleView::WidgetSlideAnimationDelegate ...@@ -211,6 +211,7 @@ class TabHoverCardBubbleView::WidgetSlideAnimationDelegate
void AnimateToAnchorView(views::View* anchor_view) { void AnimateToAnchorView(views::View* anchor_view) {
anchor_view_ = anchor_view; anchor_view_ = anchor_view;
gfx::Rect anchor_bounds = anchor_view->GetAnchorBoundsInScreen(); gfx::Rect anchor_bounds = anchor_view->GetAnchorBoundsInScreen();
anchor_bounds.Inset(bubble_delegate_->anchor_view_insets());
// If an animation is currently running we should start the next animation // If an animation is currently running we should start the next animation
// from where the previous left off. // from where the previous left off.
...@@ -257,6 +258,10 @@ TabHoverCardBubbleView::TabHoverCardBubbleView(Tab* tab) ...@@ -257,6 +258,10 @@ TabHoverCardBubbleView::TabHoverCardBubbleView(Tab* tab)
// view inside the client view. // view inside the client view.
set_margins(gfx::Insets()); set_margins(gfx::Insets());
// Inset the tab hover cards anchor rect to bring the card closer to the tab.
constexpr gfx::Insets kTabHoverCardAnchorInsets(2, 0);
set_anchor_view_insets(kTabHoverCardAnchorInsets);
// Set so that when hovering over a tab in a inactive window that window will // Set so that when hovering over a tab in a inactive window that window will
// not become active. Setting this to false creates the need to explicitly // not become active. Setting this to false creates the need to explicitly
// hide the hovercard on press, touch, and keyboard events. // hide the hovercard on press, touch, and keyboard events.
......
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