Merge branch '0.7b-integration' into 0.7b
No files matched your search
@@ -125,8 +125,8 @@ var _CPButtonClassName = nil,
|
||||
|
||||
+ (id)themedAttributes
|
||||
{
|
||||
return [CPDictionary dictionaryWithObjects:[_CGInsetMakeZero(), _CGInsetMakeZero(), nil]
|
||||
forKeys:[@"bezel-inset", @"content-inset", @"bezel-color"]];
|
||||
return [CPDictionary dictionaryWithObjects:[_CGInsetMakeZero(), _CGInsetMakeZero(), nil, 24.0]
|
||||
forKeys:[@"bezel-inset", @"content-inset", @"bezel-color", @"default-height"]];
|
||||
}
|
||||
|
||||
- (id)initWithFrame:(CGRect)aFrame
|
||||
@@ -374,6 +374,18 @@ var _CPButtonClassName = nil,
|
||||
return bounds;
|
||||
}
|
||||
|
||||
/*!
|
||||
Adjust the size of the button to fit the title and surrounding button image.
|
||||
*/
|
||||
- (void)sizeToFit
|
||||
{
|
||||
var size = [([self title] || " ") sizeWithFont:[self font]],
|
||||
contentInset = [self currentValueForThemedAttributeName:@"content-inset"],
|
||||
defaultHeight = [self currentValueForThemedAttributeName:@"default-height"];
|
||||
|
||||
[self setFrameSize:CGSizeMake(size.width + contentInset.left + contentInset.right, defaultHeight)];
|
||||
}
|
||||
|
||||
- (CGRect)rectForEphemeralSubviewNamed:(CPString)aName
|
||||
{
|
||||
if (aName === "bezel-view")
|
||||
|
||||
@@ -72,6 +72,11 @@ var _CPMenuBarVisible = NO,
|
||||
|
||||
// Managing the Menu Bar
|
||||
|
||||
+ (void)initialize
|
||||
{
|
||||
[[self class] setMenuBarAttributes:[CPDictionary dictionary]];
|
||||
}
|
||||
|
||||
+ (BOOL)menuBarVisible
|
||||
{
|
||||
return _CPMenuBarVisible;
|
||||
@@ -137,6 +142,7 @@ var _CPMenuBarVisible = NO,
|
||||
return _CPMenuBarImage;
|
||||
}
|
||||
|
||||
|
||||
+ (void)setMenuBarAttributes:(CPDictionary)attributes
|
||||
{
|
||||
if (_CPMenuBarAttributes == attributes)
|
||||
@@ -160,8 +166,8 @@ var _CPMenuBarVisible = NO,
|
||||
|
||||
else if (!textColor && !titleColor)
|
||||
{
|
||||
[_CPMenuBarAttributes setObject:[CPColor blackColor] forKey:@"CPMenuBarTextColor"];
|
||||
[_CPMenuBarAttributes setObject:[CPColor blackColor] forKey:@"CPMenuBarTitleColor"];
|
||||
[_CPMenuBarAttributes setObject:[CPColor colorWithRed:0.051 green:0.2 blue:0.275 alpha:1.0] forKey:@"CPMenuBarTextColor"];
|
||||
[_CPMenuBarAttributes setObject:[CPColor colorWithRed:0.051 green:0.2 blue:0.275 alpha:1.0] forKey:@"CPMenuBarTitleColor"];
|
||||
}
|
||||
|
||||
if (!textShadowColor && titleShadowColor)
|
||||
@@ -172,8 +178,8 @@ var _CPMenuBarVisible = NO,
|
||||
|
||||
else if (!textShadowColor && !titleShadowColor)
|
||||
{
|
||||
[_CPMenuBarAttributes setObject:[CPColor colorWithWhite:1.0 alpha:0.8] forKey:@"CPMenuBarTextShadowColor"];
|
||||
[_CPMenuBarAttributes setObject:[CPColor colorWithWhite:1.0 alpha:0.8] forKey:@"CPMenuBarTitleShadowColor"];
|
||||
[_CPMenuBarAttributes setObject:[CPColor whiteColor] forKey:@"CPMenuBarTextShadowColor"];
|
||||
[_CPMenuBarAttributes setObject:[CPColor whiteColor] forKey:@"CPMenuBarTitleShadowColor"];
|
||||
}
|
||||
|
||||
if (!highlightColor)
|
||||
@@ -1813,7 +1819,7 @@ var _CPMenuBarWindowBackgroundColor = nil,
|
||||
{
|
||||
_highlightView = [[CPView alloc] initWithFrame:frame];
|
||||
|
||||
[_highlightView setBackgroundColor:_highlightColor];
|
||||
[_highlightView setBackgroundColor:_highlightColor ? _highlightColor : [CPColor colorWithRed:95.0/255.0 green:131.0/255.0 blue:185.0/255.0 alpha:1.0]];
|
||||
}
|
||||
else
|
||||
[_highlightView setFrame:frame];
|
||||
|
||||
@@ -208,3 +208,9 @@ function CGPointFromEvent(anEvent)
|
||||
{
|
||||
return _CGPointMake(anEvent.clientX, anEvent.clientY);
|
||||
}
|
||||
|
||||
function CPStringFromInset(anInset)
|
||||
{
|
||||
return anInset.top+" "+anInset.left+" "+anInset.bottom+" "+anInset.right;
|
||||
}
|
||||
|
||||
|
Before Width: | Height: | Size: 2.8 KiB After Width: | Height: | Size: 140 B |
|
Before Width: | Height: | Size: 121 B After Width: | Height: | Size: 121 B |
|
Before Width: | Height: | Size: 109 B After Width: | Height: | Size: 109 B |
|
Before Width: | Height: | Size: 114 B After Width: | Height: | Size: 114 B |
|
Before Width: | Height: | Size: 118 B After Width: | Height: | Size: 118 B |
|
Before Width: | Height: | Size: 164 B After Width: | Height: | Size: 161 B |
|
Before Width: | Height: | Size: 161 B After Width: | Height: | Size: 161 B |
|
Before Width: | Height: | Size: 154 B After Width: | Height: | Size: 148 B |
|
Before Width: | Height: | Size: 154 B After Width: | Height: | Size: 145 B |