summaryrefslogtreecommitdiffstats
path: root/chrome/browser/autocomplete/autocomplete_popup_view_mac.mm
diff options
context:
space:
mode:
authorshess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-15 03:23:35 +0000
committershess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98>2010-07-15 03:23:35 +0000
commit2c77c96e4c474ff213c4cf2ed850970c48bbced0 (patch)
treeeaaa29a36eebbdadd3aa3e8999a0a0a68371a65d /chrome/browser/autocomplete/autocomplete_popup_view_mac.mm
parentcb889f7cf2a09ebe0b2dd92fe4fb1bdc1993ca7f (diff)
downloadchromium_src-2c77c96e4c474ff213c4cf2ed850970c48bbced0.zip
chromium_src-2c77c96e4c474ff213c4cf2ed850970c48bbced0.tar.gz
chromium_src-2c77c96e4c474ff213c4cf2ed850970c48bbced0.tar.bz2
[Mac] Line up omnibox field icons and text with popup.
BUG=49123 TEST=Start autocompleting something, check that things line up. Review URL: http://codereview.chromium.org/2968012 git-svn-id: svn://svn.chromium.org/chrome/trunk/src@52432 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autocomplete/autocomplete_popup_view_mac.mm')
-rw-r--r--chrome/browser/autocomplete/autocomplete_popup_view_mac.mm12
1 files changed, 6 insertions, 6 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_popup_view_mac.mm b/chrome/browser/autocomplete/autocomplete_popup_view_mac.mm
index d41685b..8319f00 100644
--- a/chrome/browser/autocomplete/autocomplete_popup_view_mac.mm
+++ b/chrome/browser/autocomplete/autocomplete_popup_view_mac.mm
@@ -37,11 +37,11 @@ const CGFloat kPopupFieldGap = 2.0;
// autocomplete_popup_contents_view.cc, kGlassPopupTransparency).
const CGFloat kPopupAlpha = 240.0 / 255.0;
-// How much space to leave for the left and right margins.
-const CGFloat kLeftRightMargin = 5.0;
+// How far to offset image column from the left.
+const CGFloat kImageXOffset = 2.0;
// How far to offset the text column from the left.
-const CGFloat kTextXOffset = 29.0;
+const CGFloat kTextXOffset = 25.0;
// Animation duration when animating the popup window smaller.
const NSTimeInterval kShrinkAnimationDuration = 0.1;
@@ -195,7 +195,7 @@ NSAttributedString* AutocompletePopupViewMac::MatchText(
// partially visible.
// TODO(shess): Consider revising our NSCell subclass to have two
// bits and just draw them right, rather than truncating here.
- const float textWidth = cellWidth - kTextXOffset - kLeftRightMargin;
+ const float textWidth = cellWidth - kTextXOffset;
as = ElideString(as, match.contents, font,
textWidth * kMaxContentsFraction);
@@ -494,7 +494,7 @@ void AutocompletePopupViewMac::OpenURLForRow(int row, bool force_background) {
imageRect.size = [image size];
imageRect.origin.y += kImageBaselineAdjust +
floor((NSHeight(cellFrame) - NSHeight(imageRect)) / 2);
- imageRect.origin.x += kLeftRightMargin;
+ imageRect.origin.x += kImageXOffset;
[image drawInRect:imageRect
fromRect:NSZeroRect // Entire image
operation:NSCompositeSourceOver
@@ -506,7 +506,7 @@ void AutocompletePopupViewMac::OpenURLForRow(int row, bool force_background) {
NSAttributedString* title = [self attributedTitle];
if (title) {
NSRect titleRect = cellFrame;
- titleRect.size.width -= (kTextXOffset + kLeftRightMargin);
+ titleRect.size.width -= kTextXOffset;
titleRect.origin.x += kTextXOffset;
[self drawTitle:title withFrame:titleRect inView:controlView];
}