-
Notifications
You must be signed in to change notification settings - Fork 927
/
Copy pathchrome-browser-ui-views-tabs-tab_style.cc.patch
49 lines (43 loc) · 2.34 KB
/
chrome-browser-ui-views-tabs-tab_style.cc.patch
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
diff --git a/chrome/browser/ui/views/tabs/tab_style.cc b/chrome/browser/ui/views/tabs/tab_style.cc
index 8f21aa7edbb3b0409c68e0d850541573710f993c..c77782443be84d1980cc36e54a89ed872807454d 100644
--- a/chrome/browser/ui/views/tabs/tab_style.cc
+++ b/chrome/browser/ui/views/tabs/tab_style.cc
@@ -144,7 +144,7 @@ int GetContentsHorizontalInsetSize() {
// Returns the height of the separator between tabs.
int GetSeparatorHeight() {
- return ui::MaterialDesignController::touch_ui() ? 24 : 20;
+ return ui::MaterialDesignController::touch_ui() ? 24 : 24;
}
void DrawHighlight(gfx::Canvas* canvas,
@@ -267,6 +267,7 @@ gfx::Path GM2TabStyle::GetPath(PathType path_type,
// When the radius shrinks, it leaves a gap between the bottom corners and the
// edge of the tab. Make sure we account for this - and for any adjustment we
// may have made to the location of the tab!
+ bottom_radius = 0;
const float corner_gap = (right - tab_right) - bottom_radius;
gfx::Path path;
@@ -383,7 +384,7 @@ TabStyle::SeparatorBounds GM2TabStyle::GetSeparatorBounds(float scale) const {
separator_bounds.leading =
gfx::RectF(aligned_bounds.x() + corner_radius,
aligned_bounds.y() +
- (aligned_bounds.height() - separator_size.height()) / 2,
+ aligned_bounds.height() - separator_size.height(),
separator_size.width(), separator_size.height());
separator_bounds.trailing = separator_bounds.leading;
@@ -696,12 +697,16 @@ void GM2TabStyle::PaintSeparators(gfx::Canvas* canvas) const {
SK_AlphaOPAQUE));
};
+ // Even if |separator_radius| becomes 1 native pixel the 'roundedness'
+ // will be approximated with color, although extremely subtle and
+ // likely only on screens >= 2x (i.e. separator width is 2+px)!
+ const int separator_radius = separator_bounds.leading.width() / 2;
cc::PaintFlags flags;
flags.setAntiAlias(true);
flags.setColor(separator_color(separator_opacities.left));
- canvas->DrawRect(separator_bounds.leading, flags);
+ canvas->DrawRoundRect(separator_bounds.leading, separator_radius, flags);
flags.setColor(separator_color(separator_opacities.right));
- canvas->DrawRect(separator_bounds.trailing, flags);
+ canvas->DrawRoundRect(separator_bounds.trailing, separator_radius, flags);
}
// static