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

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

Issue 2050623004: [Material][Mac] Adjustments to the Omnibox decorations (Closed) Base URL: https://chromium.googlesource.com/chromium/src.git@2743
Patch Set: Created 4 years, 6 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/location_bar/location_bar_view_mac.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/bubble_decoration.mm
diff --git a/chrome/browser/ui/cocoa/location_bar/bubble_decoration.mm b/chrome/browser/ui/cocoa/location_bar/bubble_decoration.mm
index 7bdd563e1a2d4fc05c0886bf054690ea4f26ae8e..490c8464f1f7aef036dfba2996e60b5c88d1650b 100644
--- a/chrome/browser/ui/cocoa/location_bar/bubble_decoration.mm
+++ b/chrome/browser/ui/cocoa/location_bar/bubble_decoration.mm
@@ -22,9 +22,15 @@ CGFloat BubblePadding() {
return ui::MaterialDesignController::IsModeMaterial() ? 7 : 3;
}
+// Additional padding between the divider between the omnibox text and the
+// divider. The desired value is 8px. We get 3px by subtracting the existing
+// padding in location_bar_view from 8px.
+CGFloat DividerPadding() {
+ return ui::MaterialDesignController::IsModeMaterial() ? 2.0 : 0.0;
+}
// Padding between the icon and label.
-const CGFloat kIconLabelPadding = 4.0;
+CGFloat kIconLabelPadding = 4.0;
// Inset for the background.
const CGFloat kBackgroundYInset = 4.0;
@@ -54,7 +60,8 @@ CGFloat BubbleDecoration::GetWidthForImageAndLabel(NSImage* image,
// underestimate, so floor() seems to work better.
const CGFloat label_width =
std::floor([label sizeWithAttributes:attributes_].width);
- return BubblePadding() + image_width + kIconLabelPadding + label_width;
+ return BubblePadding() + image_width + kIconLabelPadding + label_width
+ + DividerPadding();
}
NSRect BubbleDecoration::GetImageRectInFrame(NSRect frame) {
@@ -62,6 +69,7 @@ NSRect BubbleDecoration::GetImageRectInFrame(NSRect frame) {
if (image_) {
// Center the image vertically.
const NSSize imageSize = [image_ size];
+
imageRect.origin.y +=
std::floor((NSHeight(frame) - imageSize.height) / 2.0);
imageRect.size = imageSize;
« no previous file with comments | « no previous file | chrome/browser/ui/cocoa/location_bar/location_bar_view_mac.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698