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

Unified Diff: chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.mm

Issue 1905163002: [Mac][Material Design] Rework how location bar shadow is drawn. (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Fix crasher with installing a theme. 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
« no previous file with comments | « chrome/browser/ui/cocoa/location_bar/autocomplete_text_field.mm ('k') | no next file » | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.mm
diff --git a/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.mm b/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.mm
index 2bc741b3aae4ee02b7c3d3064189d7b71cd9dbb5..c27a489d8b2340f85c2e16bd8ed95371e06feb2d 100644
--- a/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.mm
+++ b/chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.mm
@@ -317,10 +317,6 @@ size_t CalculatePositionsInFrame(
// Compute the border's bezier path.
NSRect pathRect = NSInsetRect(frame, insetSize, insetSize);
- // In dark mode, make room for a shadow beneath the bottom edge.
- if (inDarkMode && isModeMaterial) {
- pathRect.size.height -= singlePixelLineWidth_;
- }
NSBezierPath* path =
[NSBezierPath bezierPathWithRoundedRect:pathRect
xRadius:kCornerRadius
@@ -369,7 +365,7 @@ size_t CalculatePositionsInFrame(
}
// Draw a highlight beneath the top edge, and a shadow beneath the bottom
- // edge.
+ // edge when on a Retina screen.
{
gfx::ScopedNSGraphicsContextSaveGState saveState;
[NSBezierPath setDefaultLineWidth:singlePixelLineWidth_];
@@ -383,10 +379,12 @@ size_t CalculatePositionsInFrame(
[NSBezierPath strokeLineFromPoint:origin
toPoint:destination];
- origin.y = destination.y = NSMaxY(pathRect) + singlePixelLineWidth_;
- [[NSColor colorWithCalibratedWhite:69 / 255. alpha:1] set];
- [NSBezierPath strokeLineFromPoint:origin
- toPoint:destination];
+ if (singlePixelLineWidth_ < 1) {
+ origin.y = destination.y = NSMaxY(pathRect) + singlePixelLineWidth_;
+ [[AutocompleteTextField shadowColor] set];
+ [NSBezierPath strokeLineFromPoint:origin
+ toPoint:destination];
+ }
}
}
} else {
« no previous file with comments | « chrome/browser/ui/cocoa/location_bar/autocomplete_text_field.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698