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

Unified Diff: chrome/browser/ui/panels/panel_titlebar_view_cocoa.mm

Issue 7734003: Implement basic theming for panel titlebars. (Closed) Base URL: svn://svn.chromium.org/chrome/trunk/src
Patch Set: . Created 9 years, 4 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/ui/panels/panel_titlebar_view_cocoa.mm
diff --git a/chrome/browser/ui/panels/panel_titlebar_view_cocoa.mm b/chrome/browser/ui/panels/panel_titlebar_view_cocoa.mm
index 0f367fc155ebef6adda43e8f9fd3937a37352559..61f0c3e586c7fa84d9a9403cc9d590f9bc5ff8e5 100644
--- a/chrome/browser/ui/panels/panel_titlebar_view_cocoa.mm
+++ b/chrome/browser/ui/panels/panel_titlebar_view_cocoa.mm
@@ -7,9 +7,12 @@
#import <Cocoa/Cocoa.h>
#include "base/logging.h"
+#include "chrome/browser/themes/theme_service.h"
+#import "chrome/browser/ui/cocoa/themed_window.h"
#import "chrome/browser/ui/cocoa/tracking_area.h"
#import "chrome/browser/ui/panels/panel_window_controller_cocoa.h"
#import "third_party/GTM/AppKit/GTMNSBezierPath+RoundRect.h"
+#include "ui/base/theme_provider.h"
const int kRoundedCornerSize = 6;
const int kCloseButtonLeftPadding = 8;
@@ -45,13 +48,10 @@ const int kCloseButtonLeftPadding = 8;
topRightCornerRadius:kRoundedCornerSize
bottomLeftCornerRadius:0.0
bottomRightCornerRadius:0.0];
- // TODO(dimich): paint theme image here.
- [[NSColor colorWithDeviceRed:1 green:1 blue:0 alpha:0.9] setFill];
- [path fill];
- [[NSColor colorWithCalibratedWhite:0.4 alpha:1.0] set];
- NSPoint from = [self bounds].origin;
- NSPoint to = NSMakePoint(from.x + NSWidth([self bounds]), from.y);
- [NSBezierPath strokeLineFromPoint:from toPoint:to];
+ [path addClip];
+ NSPoint phase = [[self window] themePatternPhase];
+ [[NSGraphicsContext currentContext] setPatternPhase:phase];
+ [self drawBackgroundWithOpaque:YES];
}
- (void)attach {
@@ -84,6 +84,10 @@ const int kCloseButtonLeftPadding = 8;
[self setAutoresizingMask:(NSViewMinYMargin | NSViewWidthSizable)];
}
+- (void)setTitle:(NSString*)newTitle {
+ // TODO(dcheng): Implement.
+}
+
- (void)updateCloseButtonLayout {
NSRect buttonBounds = [closeButton_ bounds];
NSRect bounds = [self bounds];

Powered by Google App Engine
This is Rietveld 408576698