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

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..b7f024c95629bd63a2ddee60038c128db7b599d4 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];
Dmitry Titov 2011/08/25 00:08:21 It seems there should be more to it. See, for exam
dcheng 2011/08/25 18:48:54 I agree, but I would be more comfortable splitting
Dmitry Titov 2011/08/25 19:24:51 Ok, I'm fine with smaller patches.
}
- (void)attach {

Powered by Google App Engine
This is Rietveld 408576698