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

Unified Diff: chrome/browser/ui/cocoa/omnibox/omnibox_popup_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 | « chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.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/omnibox/omnibox_popup_cell.mm
diff --git a/chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell.mm b/chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell.mm
index afae0a6c443a3d84258f692925ce6e27bb4c610e..67635d36ec48c4479f9524b3fcfdbfc0b3510af7 100644
--- a/chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell.mm
+++ b/chrome/browser/ui/cocoa/omnibox/omnibox_popup_cell.mm
@@ -30,9 +30,6 @@
namespace {
-// How far to offset image column from the left.
-const CGFloat kImageXOffset = 5.0;
-
// How far to offset text.
const CGFloat kVerticalTextPadding = 3.0;
@@ -40,7 +37,7 @@ const CGFloat kVerticalImagePadding = 3.0;
const CGFloat kMaterialVerticalImagePadding = 5.0;
const CGFloat kTextStartOffset = 28.0;
-const CGFloat kMaterialTextStartOffset = 26.0;
+const CGFloat kMaterialTextStartOffset = 27.0;
// Rounding radius of selection and hover background on popup items.
const CGFloat kCellRoundingRadius = 2.0;
@@ -53,6 +50,16 @@ CGFloat VerticalImagePadding() {
return kMaterialVerticalImagePadding;
}
+// How far to offset the image column from the left.
+CGFloat ImageXOffset() {
+ const CGFloat kImageXOffset = 5.0;
+ const CGFloat kMaterialImageXOffset = 6.0;
+ if (!ui::MaterialDesignController::IsModeMaterial()) {
+ return kImageXOffset;
+ }
+ return kMaterialImageXOffset;
+}
+
// How far to offset the text column from the left.
CGFloat TextStartOffset() {
if (!ui::MaterialDesignController::IsModeMaterial()) {
@@ -510,7 +517,7 @@ NSAttributedString* CreateClassifiedAttributedString(
NSImage* theImage =
isDarkTheme ? [cellData incognitoImage] : [cellData image];
imageRect.size = [theImage size];
- imageRect.origin.x += kImageXOffset + [tableView contentLeftPadding];
+ imageRect.origin.x += ImageXOffset() + [tableView contentLeftPadding];
imageRect.origin.y += VerticalImagePadding();
[theImage drawInRect:FlipIfRTL(imageRect, cellFrame)
fromRect:NSZeroRect
« no previous file with comments | « chrome/browser/ui/cocoa/location_bar/autocomplete_text_field_cell.mm ('k') | no next file » | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698