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

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

Issue 1857093002: [Mac] Fix tabstrip background opacity problem when dragging tabs. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Rework tab dragging detection. Created 4 years, 8 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
Index: chrome/browser/ui/cocoa/tabs/tab_strip_view.mm
diff --git a/chrome/browser/ui/cocoa/tabs/tab_strip_view.mm b/chrome/browser/ui/cocoa/tabs/tab_strip_view.mm
index 0b26910184e1222cd6ced8504258eea3014f4cc5..e242b32a65215beb5c03af6ecd65607fad30f908 100644
--- a/chrome/browser/ui/cocoa/tabs/tab_strip_view.mm
+++ b/chrome/browser/ui/cocoa/tabs/tab_strip_view.mm
@@ -30,6 +30,7 @@
@synthesize dropArrowShown = dropArrowShown_;
@synthesize dropArrowPosition = dropArrowPosition_;
+@synthesize inATabDraggingOverlayWindow = inATabDraggingOverlayWindow_;
- (id)initWithFrame:(NSRect)frame {
self = [super initWithFrame:frame];
@@ -118,11 +119,15 @@
BOOL supportsVibrancy = [self visualEffectView] != nil;
BOOL isMainWindow = [[self window] isMainWindow];
- if (themeProvider && !hasCustomThemeImage && isModeMaterial) {
+ // If in Material Design mode, decrease the tabstrip background's translucency
+ // by overlaying it with a partially-transparent gray (but only if not themed,
+ // and not being used to drag tabs between browser windows). The gray is
+ // somewhat opaque for Incognito mode, very opaque for non-Incognito mode, and
+ // completely opaque when the window is not active.
+ if (themeProvider && !hasCustomThemeImage && isModeMaterial &&
+ !inATabDraggingOverlayWindow_) {
NSColor* theColor = nil;
if (isMainWindow) {
- // The vibrancy overlay makes the Incognito NSVisualEffectView
- // somewhat darker, and the non-Incognito NSVisualEffectView much darker.
if (supportsVibrancy &&
!themeProvider->HasCustomColor(ThemeProperties::COLOR_FRAME)) {
theColor = themeProvider->GetNSColor(
@@ -131,7 +136,6 @@
theColor = themeProvider->GetNSColor(ThemeProperties::COLOR_FRAME);
}
} else {
- // Inactive MD windows always draw a solid color.
theColor = themeProvider->GetNSColor(
ThemeProperties::COLOR_FRAME_INACTIVE);
}
« no previous file with comments | « chrome/browser/ui/cocoa/tabs/tab_strip_view.h ('k') | chrome/browser/ui/cocoa/tabs/tab_window_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698