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

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

Issue 260009: Several background pattern fixes on the Mac.... (Closed) Base URL: http://src.chromium.org/svn/trunk/src/
Patch Set: '' Created 11 years, 2 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 | « chrome/browser/cocoa/chrome_browser_window_unittest.mm ('k') | chrome/browser/cocoa/find_bar_view.mm » ('j') | no next file with comments »
Expand Comments ('e') | Collapse Comments ('c') | Show Comments Hide Comments ('s')
Index: chrome/browser/cocoa/download_shelf_view.mm
===================================================================
--- chrome/browser/cocoa/download_shelf_view.mm (revision 28537)
+++ chrome/browser/cocoa/download_shelf_view.mm (working copy)
@@ -17,17 +17,20 @@
- (void)drawRect:(NSRect)rect {
BOOL isKey = [[self window] isKeyWindow];
- GTMTheme *theme = [self gtm_theme];
+ GTMTheme* theme = [self gtm_theme];
- NSImage *backgroundImage = [theme backgroundImageForStyle:GTMThemeStyleToolBar
+ NSImage* backgroundImage = [theme backgroundImageForStyle:GTMThemeStyleToolBar
state:GTMThemeStateActiveWindow];
if (backgroundImage) {
- [[NSGraphicsContext currentContext] setPatternPhase:NSZeroPoint];
- NSColor *color = [NSColor colorWithPatternImage:backgroundImage];
+ // We want our backgrounds for the shelf to be phased from the upper
+ // left hand corner of the view.
+ NSPoint phase = NSMakePoint(0, NSHeight([self bounds]));
+ [[NSGraphicsContext currentContext] setPatternPhase:phase];
+ NSColor* color = [NSColor colorWithPatternImage:backgroundImage];
[color set];
NSRectFill([self bounds]);
} else {
- NSGradient *gradient = [theme gradientForStyle:GTMThemeStyleToolBar
+ NSGradient* gradient = [theme gradientForStyle:GTMThemeStyleToolBar
state:isKey];
NSPoint startPoint = [self convertPointFromBase:NSMakePoint(0, 0)];
NSPoint endPoint = [self convertPointFromBase:
« no previous file with comments | « chrome/browser/cocoa/chrome_browser_window_unittest.mm ('k') | chrome/browser/cocoa/find_bar_view.mm » ('j') | no next file with comments »

Powered by Google App Engine
This is Rietveld 408576698