diff options
author | shess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-01 17:22:25 +0000 |
---|---|---|
committer | shess@chromium.org <shess@chromium.org@0039d316-1c4b-4281-b951-d872f2087c98> | 2010-04-01 17:22:25 +0000 |
commit | ff920f7685e372765f875189019fd6099200186f (patch) | |
tree | 2ee8de4e49fdd36b49030b3e15c7b884e0e09e3f /chrome/browser/autocomplete | |
parent | 0614bad929b227c0ca6bccfe7a7644068fb8dd7a (diff) | |
download | chromium_src-ff920f7685e372765f875189019fd6099200186f.zip chromium_src-ff920f7685e372765f875189019fd6099200186f.tar.gz chromium_src-ff920f7685e372765f875189019fd6099200186f.tar.bz2 |
[Mac] Line up omnibox popup under field.
Also line up the icons. Spacing can be adjusted later.
BUG=37865
TEST=Popup edges line up under field edges.
TEST=Popup icons and text should line up under field icon and text.
Review URL: http://codereview.chromium.org/1608001
git-svn-id: svn://svn.chromium.org/chrome/trunk/src@43357 0039d316-1c4b-4281-b951-d872f2087c98
Diffstat (limited to 'chrome/browser/autocomplete')
-rw-r--r-- | chrome/browser/autocomplete/autocomplete_popup_view_mac.mm | 14 |
1 files changed, 10 insertions, 4 deletions
diff --git a/chrome/browser/autocomplete/autocomplete_popup_view_mac.mm b/chrome/browser/autocomplete/autocomplete_popup_view_mac.mm index 6407475..973ed67 100644 --- a/chrome/browser/autocomplete/autocomplete_popup_view_mac.mm +++ b/chrome/browser/autocomplete/autocomplete_popup_view_mac.mm @@ -15,6 +15,7 @@ #include "gfx/rect.h" #include "grit/theme_resources.h" #import "third_party/GTM/AppKit/GTMNSAnimation+Duration.h" +#import "third_party/GTM/AppKit/GTMNSBezierPath+RoundRect.h" namespace { @@ -31,7 +32,7 @@ const int kCellHeightAdjust = 7.0; const CGFloat kPopupRoundingRadius = 3.5; // Gap between the field and the popup. -const CGFloat kPopupFieldGap = 2.0; +const CGFloat kPopupFieldGap = 0.0; // How opaque the popup window should be. This matches Windows (see // autocomplete_popup_contents_view.cc, kGlassPopupTransparency). @@ -665,10 +666,15 @@ void AutocompletePopupViewMac::OpenURLForRow(int row, bool force_background) { // This handles drawing the decorations of the rounded popup window, // calling on NSMatrix to draw the actual contents. - (void)drawRect:(NSRect)rect { + // Apparently this expects flipped coordinates, because in order to + // round the bottom corners visually, I need to specify the top + // corners here. NSBezierPath* path = - [NSBezierPath bezierPathWithRoundedRect:[self bounds] - xRadius:kPopupRoundingRadius - yRadius:kPopupRoundingRadius]; + [NSBezierPath gtm_bezierPathWithRoundRect:[self bounds] + topLeftCornerRadius:kPopupRoundingRadius + topRightCornerRadius:kPopupRoundingRadius + bottomLeftCornerRadius:0.0 + bottomRightCornerRadius:0.0]; // Draw the matrix clipped to our border. [NSGraphicsContext saveGraphicsState]; |