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

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

Issue 1608001: [Mac] Line up omnibox popup under field. (Closed)
Patch Set: Wordsmith and test fix. Created 10 years, 9 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/cocoa/autocomplete_text_field_cell.mm
diff --git a/chrome/browser/cocoa/autocomplete_text_field_cell.mm b/chrome/browser/cocoa/autocomplete_text_field_cell.mm
index 0543bf6e3bebaf8e183d2e36bbbb78514d5a07c6..3c29f8b70d58306a0ab5a1d6aaf4885c36a0bd4b 100644
--- a/chrome/browser/cocoa/autocomplete_text_field_cell.mm
+++ b/chrome/browser/cocoa/autocomplete_text_field_cell.mm
@@ -45,7 +45,9 @@ const NSInteger kIconLabelYOffset = 7;
// decorations need to be trimmed.
const CGFloat kEditorHorizontalInset = 3.0;
-const CGFloat kLocationIconXOffset = 3.0;
+// Cause the location icon to line up above the icons in the popup.
+const CGFloat kLocationIconXOffset = 9.0;
+const CGFloat kLocationIconXPad = 5.0;
// Conveniences to centralize width+offset calculations.
CGFloat WidthForHint(NSAttributedString* hintString) {
@@ -288,8 +290,10 @@ void DrawImageInRect(NSImage* image, NSView* view, const NSRect& rect) {
// code could be made simpler.
if (!keywordString_ && locationIconView_ && locationIconView_->IsVisible()) {
const NSSize imageSize = locationIconView_->GetImageSize();
- textFrame.origin.x += imageSize.width;
- textFrame.size.width -= imageSize.width;
+ const CGFloat locationIconWidth =
+ kLocationIconXOffset + kLocationIconXPad + imageSize.width;
+ textFrame.origin.x += locationIconWidth;
+ textFrame.size.width -= locationIconWidth;
}
if (hintString_) {
« no previous file with comments | « chrome/browser/autocomplete/autocomplete_popup_view_mac.mm ('k') | chrome/browser/cocoa/toolbar_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698