Permalink
Browse files

nib2cib support for CPProgressIndicator size. Fixed: a regular size s…

…pinner in IB became twice as large in Cappuccino.
  • Loading branch information...
1 parent da055f8 commit 6715fbbce2c2729535a14d332e8a62717dd9614c @aljungberg aljungberg committed May 3, 2012
Showing with 9 additions and 7 deletions.
  1. +9 −7 Tools/nib2cib/NSProgressIndicator.j
@@ -40,20 +40,22 @@ 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.
_doubleValue = 0.0;
// 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];

0 comments on commit 6715fbb

Please sign in to comment.