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

Unified Diff: chrome/browser/autocomplete/autocomplete_popup_view_mac.mm

Issue 185013: [Mac] Drop shadow for Omnibox popup. (Closed)
Patch Set: Oops, another CL masked something. Created 11 years, 3 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/cocoa/toolbar_controller.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/autocomplete/autocomplete_popup_view_mac.mm
diff --git a/chrome/browser/autocomplete/autocomplete_popup_view_mac.mm b/chrome/browser/autocomplete/autocomplete_popup_view_mac.mm
index 6cc22069f915f36e0c0da79bc953f5610ed9f8e3..950a4e21d1ea5255a1a164e03c1099c80484a8ec 100644
--- a/chrome/browser/autocomplete/autocomplete_popup_view_mac.mm
+++ b/chrome/browser/autocomplete/autocomplete_popup_view_mac.mm
@@ -294,9 +294,12 @@ void AutocompletePopupViewMac::CreatePopupIfNeeded() {
backing:NSBackingStoreBuffered
defer:YES]);
[popup_ setMovableByWindowBackground:NO];
- // The window will have rounded borders.
+ // The window shape is determined by the content view
+ // (AutocompleteMatrix).
[popup_ setAlphaValue:1.0];
[popup_ setOpaque:NO];
+ [popup_ setBackgroundColor:[NSColor clearColor]];
+ [popup_ setHasShadow:YES];
[popup_ setLevel:NSNormalWindowLevel];
AutocompleteMatrix* matrix =
@@ -631,20 +634,15 @@ void AutocompletePopupViewMac::OnMiddleClick() {
middleClickAction_ = anAction;
}
+- (BOOL)isOpaque {
+ return NO;
+}
Scott Hess - ex-Googler 2009/09/03 18:45:12 Oops - looks like I had forgotten a bit in my clea
+
// This handles drawing the decorations of the rounded popup window,
// calling on NSMatrix to draw the actual contents.
- (void)drawRect:(NSRect)rect {
- // Background clear so we can round the corners.
- [[NSColor clearColor] set];
- NSRectFill([self frame]);
-
- // The toolbar items we're mirroring for shape are inset slightly
- // for width. I don't know why, which is why I didn't make this a
- // constant, yet. The factor of 0.5 on both dimensions is to put
- // the stroke down the middle of the pixels.
- const NSRect border(NSInsetRect([self bounds], 1.5, 0.5));
NSBezierPath* path =
- [NSBezierPath bezierPathWithRoundedRect:border
+ [NSBezierPath bezierPathWithRoundedRect:[self bounds]
xRadius:kPopupRoundingRadius
yRadius:kPopupRoundingRadius];
@@ -653,12 +651,6 @@ void AutocompletePopupViewMac::OnMiddleClick() {
[path addClip];
[super drawRect:rect];
[NSGraphicsContext restoreGraphicsState];
-
- // Put a border over that.
- // TODO(shess): Theme the color?
- [[NSColor lightGrayColor] setStroke];
- [path setLineWidth:1.0];
- [path stroke];
}
@end
« no previous file with comments | « no previous file | chrome/browser/cocoa/toolbar_controller.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698