From f28ac434460bdb33056e7766caeb28bcd4d5e2eb Mon Sep 17 00:00:00 2001 From: Alexandre Wilhelm Date: Wed, 9 Jan 2013 18:53:09 -0800 Subject: [PATCH] Added support for _CPBorderlessBridgeWindowView.j theme --- .../CPWindow/_CPBorderlessBridgeWindowView.j | 23 +++++++------------ 1 file changed, 8 insertions(+), 15 deletions(-) diff --git a/AppKit/CPWindow/_CPBorderlessBridgeWindowView.j b/AppKit/CPWindow/_CPBorderlessBridgeWindowView.j index 05959e4b5..c59b10e8c 100644 --- a/AppKit/CPWindow/_CPBorderlessBridgeWindowView.j +++ b/AppKit/CPWindow/_CPBorderlessBridgeWindowView.j @@ -22,27 +22,20 @@ @import "_CPWindowView.j" - -var _CPToolbarViewBackgroundColor = nil; - @implementation _CPBorderlessBridgeWindowView : _CPWindowView { CPView _toolbarBackgroundView; } -+ (CPColor)toolbarBackgroundColor ++ (CPString)defaultThemeClass { - if (!_CPToolbarViewBackgroundColor) - { - var bundle = [CPBundle bundleForClass:[_CPBorderlessBridgeWindowView class]]; - _CPToolbarViewBackgroundColor = CPColorWithImages([ - ["_CPToolbarView/toolbar-background-top.png", 1, 1, bundle], - ["_CPToolbarView/toolbar-background-center.png", 1, 57.0, bundle], - ["_CPToolbarView/toolbar-background-bottom.png", 1, 1, bundle] - ], CPColorPatternIsVertical); - } + return @"bordeless-bridge-window-view"; +} - return _CPToolbarViewBackgroundColor; ++ (id)themeAttributes +{ + return [CPDictionary dictionaryWithObjects:[[CPColor grayColor]] + forKeys:[@"toolbar-background-color"]]; } - (void)setShowsResizeIndicator:(BOOL)shouldShowResizeIndicator @@ -72,7 +65,7 @@ var _CPToolbarViewBackgroundColor = nil; { _toolbarBackgroundView = [[CPView alloc] initWithFrame:CGRectMakeZero()]; - [_toolbarBackgroundView setBackgroundColor:[[self class] toolbarBackgroundColor]]; + [_toolbarBackgroundView setBackgroundColor:[self valueForThemeAttribute:@"toolbar-background-color"]]; [_toolbarBackgroundView setAutoresizingMask:CPViewWidthSizable]; [self addSubview:_toolbarBackgroundView positioned:CPWindowBelow relativeTo:nil];