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

Unified Diff: chrome/browser/ui/cocoa/tabs/tab_view.mm

Issue 1829443002: Fix regression in inactive tab drawing (Mac). (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 9 months ago
Use n/p to move between diff chunks; N/P to move between comments. Draft comments are only viewable by you.
Jump to:
View side-by-side diff with in-line comments
Download patch
« no previous file with comments | « no previous file | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/tabs/tab_view.mm
diff --git a/chrome/browser/ui/cocoa/tabs/tab_view.mm b/chrome/browser/ui/cocoa/tabs/tab_view.mm
index 98d1e5b792aa313e45c33ea28d0c80452fca32a9..026e3fc7d945a1ab7a05a8ca383e62e45f3b35ee 100644
--- a/chrome/browser/ui/cocoa/tabs/tab_view.mm
+++ b/chrome/browser/ui/cocoa/tabs/tab_view.mm
@@ -107,7 +107,15 @@ ui::ThreePartImage& GetMaskImage() {
return mask;
}
-ui::ThreePartImage& GetStrokeImage() {
+ui::ThreePartImage& GetStrokeImage(bool active) {
+ if (!ui::MaterialDesignController::IsModeMaterial() && !active) {
+ CR_DEFINE_STATIC_LOCAL(
+ ui::ThreePartImage, inactiveStroke,
+ (imageForResourceID(IDR_TAB_INACTIVE_LEFT),
+ imageForResourceID(IDR_TAB_INACTIVE_CENTER),
+ imageForResourceID(IDR_TAB_INACTIVE_RIGHT)));
+ return inactiveStroke;
+ }
CR_DEFINE_STATIC_LOCAL(
ui::ThreePartImage, stroke,
(imageForResourceID(IDR_TAB_ACTIVE_LEFT),
@@ -477,7 +485,8 @@ CGFloat LineWidthFromContext(CGContextRef context) {
// In MD, the tab stroke is always opaque.
alpha = 1;
}
- GetStrokeImage().DrawInRect(bounds, NSCompositeSourceOver, alpha);
+ GetStrokeImage(state_ == NSOnState)
+ .DrawInRect(bounds, NSCompositeSourceOver, alpha);
}
- (void)drawRect:(NSRect)dirtyRect {
« no previous file with comments | « no previous file | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698