Commit 03555249 authored by Allen Bauer's avatar Allen Bauer Committed by Commit Bot

Material Refresh - Make separator 20dip instead of 16dip. Always show close button on active tabs.

GetOpacity() didn't handle the active tab case where the close button should be always visible.



Bug: 822061
Bug: 842218
Change-Id: Id91e5ab402fb1e9e249f8cb60d1a26a3c9a3c46e
Reviewed-on: https://chromium-review.googlesource.com/1055648
Commit-Queue: Allen Bauer <kylixrd@chromium.org>
Reviewed-by: default avatarBret Sepulveda <bsep@chromium.org>
Cr-Commit-Position: refs/heads/master@{#558717}
parent 5ba8e281
...@@ -1205,7 +1205,7 @@ void Tab::PaintSeparator(gfx::Canvas* canvas, SkColor inactive_color) { ...@@ -1205,7 +1205,7 @@ void Tab::PaintSeparator(gfx::Canvas* canvas, SkColor inactive_color) {
const int tab_height = GetContentsBounds().height(); const int tab_height = GetContentsBounds().height();
gfx::RectF separator_bounds; gfx::RectF separator_bounds;
separator_bounds.set_size(gfx::SizeF(1, 16)); separator_bounds.set_size(gfx::SizeF(1, 20));
separator_bounds.set_origin(gfx::PointF( separator_bounds.set_origin(gfx::PointF(
GetTabEndcapWidth() / 2, (tab_height - separator_bounds.height()) / 2)); GetTabEndcapWidth() / 2, (tab_height - separator_bounds.height()) / 2));
// The following will paint the separator using an opacity that should // The following will paint the separator using an opacity that should
......
...@@ -146,10 +146,10 @@ bool TabCloseButton::GetHitTestMask(gfx::Path* mask) const { ...@@ -146,10 +146,10 @@ bool TabCloseButton::GetHitTestMask(gfx::Path* mask) const {
} }
SkAlpha TabCloseButton::GetOpacity() { SkAlpha TabCloseButton::GetOpacity() {
if (!MD::IsRefreshUi() && !IsMouseHovered()) Tab* tab = static_cast<Tab*>(parent());
if (!MD::IsRefreshUi() || IsMouseHovered() || tab->IsActive())
return SK_AlphaOPAQUE; return SK_AlphaOPAQUE;
const double animation_value = const double animation_value = tab->hover_controller()->GetAnimationValue();
static_cast<Tab*>(parent())->hover_controller()->GetAnimationValue();
return gfx::Tween::IntValueBetween(animation_value, 0, 255); return gfx::Tween::IntValueBetween(animation_value, 0, 255);
} }
......
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