nib2cib support for CPProgressIndicator size. Fixed: a regular size spinner in IB became twice as large in Cappuccino.

This commit is contained in:
Alexander Ljungberg
2012-05-03 20:27:05 +01:00
parent da055f83b3
commit 6715fbbce2
+9 -7
View File
@@ -40,7 +40,14 @@ var NSProgressIndicatorSpinningFlag = 1 << 12;
_style = (NS_flags & NSProgressIndicatorSpinningFlag) ? CPProgressIndicatorSpinningStyle : CPProgressIndicatorBarStyle;
_isIndeterminate = (NS_flags & 2) ? YES : NO;
_isDisplayedWhenStopped = (NS_flags & 8192) ? NO : YES;
_controlSize = CPRegularControlSize;
_controlSize = (NS_flags & 256) ? CPSmallControlSize : CPRegularControlSize;
if (_style === CPProgressIndicatorSpinningStyle)
{
// For whatever reason, our 'regular' size is larger than any Cocoa size, our 'small' size is Cocoa's regular and
// our 'mini' size is Cocoa's small.
_controlSize = _controlSize == CPRegularControlSize ? CPSmallControlSize : CPMiniControlSize;
}
// There is a bug in Xcode. the currentValue is not stored.
// Let's set it to 0.0 for now.
@@ -48,12 +55,7 @@ var NSProgressIndicatorSpinningFlag = 1 << 12;
// Readjust the height of the control to the correct size.
var currentFrameSize = [self frameSize];
if (_style == CPProgressIndicatorSpinningStyle)
{
currentFrameSize.height = 64.0;
currentFrameSize.width = 64.0;
}
else
if (_style !== CPProgressIndicatorSpinningStyle)
currentFrameSize.height = 15.0;
[self setFrameSize:currentFrameSize];