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

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

Issue 1997473006: [Material][Mac]Move the Omnibox left icons 1px to the right (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@master
Patch Set: Created 4 years, 7 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 | chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell.mm » ('j') | 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 2a0e7da4f0a41475947a6de4839279db5a3de3cb..ef0ddd32bb4a27bded9a8c6c2e74e7097deb1ec5 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
@@ -31,8 +31,14 @@ const CGFloat kCornerRadius = 3.0;
// How far to inset the left- and right-hand decorations from the field's
// bounds.
-const CGFloat kLeftDecorationXOffset = 5.0;
const CGFloat kRightDecorationXOffset = 5.0;
+CGFloat LeftDecorationXOffset() {
+ const CGFloat kLeftDecorationXOffset = 5.0;
+ const CGFloat kLeftMaterialDecorationXOffset = 6.0;
+ return ui::MaterialDesignController::IsModeMaterial()
+ ? kLeftMaterialDecorationXOffset
+ : kLeftDecorationXOffset;
+}
// The amount of padding on either side reserved for drawing
// decorations. [Views has |kItemPadding| == 3.]
@@ -141,7 +147,7 @@ size_t CalculatePositionsInFrame(
// Layout |left_decorations| against the LHS.
CalculatePositionsHelper(frame, left_decorations, NSMinXEdge,
- kLeftDecorationXOffset, decorations,
+ LeftDecorationXOffset(), decorations,
decoration_frames, &frame);
DCHECK_EQ(decorations->size(), decoration_frames->size());
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698