mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-08-31 16:03:37 +00:00
Merge branch 'master' of git://github.com/280north/cappuccino
This commit is contained in:
@@ -530,6 +530,7 @@ CPButtonStateMixed = CPThemeState("mixed");
|
||||
[contentView setTextShadowOffset:[self currentValueForThemeAttribute:@"text-shadow-offset"]];
|
||||
[contentView setImagePosition:[self currentValueForThemeAttribute:@"image-position"]];
|
||||
[contentView setImageScaling:[self currentValueForThemeAttribute:@"image-scaling"]];
|
||||
[contentView setDimsImage:[self hasThemeState:CPThemeStateDisabled] && _imageDimsWhenDisabled];
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
@@ -365,7 +365,7 @@ var LEFT_SHADOW_INSET = 3.0,
|
||||
return _isEditable;
|
||||
}
|
||||
|
||||
- (void)performDragOperation:(CPDraggingInfo)aSender
|
||||
- (BOOL)performDragOperation:(CPDraggingInfo)aSender
|
||||
{
|
||||
var images = [CPKeyedUnarchiver unarchiveObjectWithData:[[aSender draggingPasteboard] dataForType:CPImagesPboardType]];
|
||||
|
||||
@@ -374,6 +374,8 @@ var LEFT_SHADOW_INSET = 3.0,
|
||||
[self setImage:images[0]];
|
||||
[self sendAction:[self action] to:[self target]];
|
||||
}
|
||||
|
||||
return YES;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -63,6 +63,7 @@ var HORIZONTAL_MARGIN = 3.0,
|
||||
|
||||
CPCellImagePosition _imagePosition;
|
||||
CPImageScaling _imageScaling;
|
||||
BOOL _shouldDimImage;
|
||||
|
||||
CPImage _image;
|
||||
CPString _text;
|
||||
@@ -211,6 +212,17 @@ var HORIZONTAL_MARGIN = 3.0,
|
||||
return _imageScaling;
|
||||
}
|
||||
|
||||
- (void)setDimsImage:(BOOL)shouldDim
|
||||
{
|
||||
var shouldDimImage = !!shouldDimImage;
|
||||
|
||||
if (_shouldDimImage !== shouldDimImage)
|
||||
{
|
||||
_shouldDimImage = shouldDim;
|
||||
[self setNeedsLayout];
|
||||
}
|
||||
}
|
||||
|
||||
- (void)setTextColor:(CPColor)aTextColor
|
||||
{
|
||||
if (_textColor === aTextColor)
|
||||
@@ -572,6 +584,11 @@ var HORIZONTAL_MARGIN = 3.0,
|
||||
imageHeight *= scale;
|
||||
}
|
||||
|
||||
if (CPFeatureIsCompatible(CPOpacityRequiresFilterFeature))
|
||||
imageStyle.filter = @"alpha(opacity=" + _shouldDimImage ? 35 : 100 + ")";
|
||||
else
|
||||
imageStyle.opacity = _shouldDimImage ? 0.35 : 1.0;
|
||||
|
||||
_DOMImageElement.width = imageWidth;
|
||||
_DOMImageElement.height = imageHeight;
|
||||
imageStyle.width = MAX(imageWidth, 0) + "px";
|
||||
|
||||
@@ -271,7 +271,7 @@ var CPRunLoopLastNativeRunLoop = 0;
|
||||
|
||||
|
||||
// FIXME: Hack for not doing this in CommonJS
|
||||
if (CFBundle.environments().indexOf("Browser") !== -1)
|
||||
if ([CFBundle.environments() indexOfObject:("Browser")] !== CPNotFound)
|
||||
{
|
||||
if (!_runLoopInsuranceTimer)
|
||||
_runLoopInsuranceTimer = window.setNativeTimeout(function()
|
||||
@@ -293,7 +293,7 @@ var CPRunLoopLastNativeRunLoop = 0;
|
||||
_runLoopLock = YES;
|
||||
|
||||
// FIXME: Hack for not doing this in CommonJS
|
||||
if (CFBundle.environments().indexOf("Browser") !== -1)
|
||||
if ([CFBundle.environments() indexOfObject:("Browser")] !== CPNotFound)
|
||||
{
|
||||
if (_runLoopInsuranceTimer)
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user