fix _adjustNib2CibSize calls

This commit is contained in:
Christophe Serafin
2014-08-18 13:08:09 -07:00
parent 7323a5e393
commit 62e8d70d74
12 changed files with 20 additions and 35 deletions
+1 -1
View File
@@ -136,7 +136,7 @@ var CPControlBlackColor = [CPColor blackColor];
@"image-scaling": CPScaleToFit,
@"min-size": CGSizeMakeZero(),
@"max-size": CGSizeMake(-1.0, -1.0),
@"nib2cib-adjustment-frame" : CGRectMakeZero(),
@"nib2cib-adjustment-frame": CGRectMakeZero()
};
}
+1 -4
View File
@@ -170,8 +170,6 @@ var NSButtonIsBorderedMask = 0x00800000,
maxSize = [theme valueForAttributeWithName:@"max-size" forClass:[self class]],
adjustHeight = NO;
// CPLog.error([self class] + " Frame Adjustment = (" + frameAdjustment.origin.x + ", " + frameAdjustment.origin.y + ", " + frameAdjustment.size.width + ", " + frameAdjustment.size.width + ")")
if (minSize.height > 0 && maxSize.height > 0 && minSize.height === maxSize.height)
{
adjustHeight = YES;
@@ -210,8 +208,6 @@ var NSButtonIsBorderedMask = 0x00800000,
_highlightsBy = [cell highlightsBy];
_showsStateBy = [cell showsStateBy];
[self _adjustNib2CibSize];
}
/*!
@@ -398,6 +394,7 @@ var NSButtonIsBorderedMask = 0x00800000,
{
var cell = [aCoder decodeObjectForKey:@"NSCell"];
[self NS_initWithCell:cell];
[self _adjustNib2CibSize];
}
return self;
+1 -8
View File
@@ -46,14 +46,6 @@
_hasVerticalScroller = [cell hasVerticalScroller];
[self setButtonBordered:[cell borderedButton]];
[self setEnabled:[cell isEnabled]];
// Make sure the height is clipped to the max given by the theme
var theme = [Nib2Cib defaultTheme],
maxSize = [theme valueForAttributeWithName:@"max-size" forClass:[CPComboBox class]],
size = [self frameSize],
widthOffset = -3;
[self _adjustNib2CibSize];
}
@end
@@ -68,6 +60,7 @@
{
var cell = [aCoder decodeObjectForKey:@"NSCell"];
[self NS_initWithCell:cell];
[self _adjustNib2CibSize];
}
return self;
+9 -2
View File
@@ -69,8 +69,15 @@
- (CGRect)_nib2CibAdjustment
{
var theme = [Nib2Cib defaultTheme];
return [theme valueForAttributeWithName:@"nib2cib-adjustment-frame" inState:[self themeState] forClass:[self class]];
// Theme has not been loaded yet.
// Get attribute value directly from the theme or from the default value of the object otherwise.
var theme = [Nib2Cib defaultTheme],
frameAdjustment = [theme valueForAttributeWithName:@"nib2cib-adjustment-frame" inState:[self themeState] forClass:[self class]];
if (!frameAdjustment)
frameAdjustment = [self currentValueForThemeAttribute:@"nib2cib-adjustment-frame"];
return frameAdjustment;
}
- (void)_adjustNib2CibSize
+1 -8
View File
@@ -145,12 +145,6 @@ var NSDatePickerDefaultSize = 22,
return self;
}
- (void)NS_initWithCell:(NSCell)cell
{
[super NS_initWithCell:cell];
[self _adjustNib2CibSize];
}
@end
@@ -164,8 +158,7 @@ var NSDatePickerDefaultSize = 22,
if (self)
{
var cell = [aCoder decodeObjectForKey:@"NSCell"];
[self NS_initWithCell:cell];
[self _adjustNib2CibSize];
}
return self
+1 -2
View File
@@ -39,8 +39,6 @@
[self setImageScaling:[cell imageScaling]];
[self setImageAlignment:[cell imageAlignment]];
_isEditable = [cell isEditable];
[self _adjustNib2CibSize];
}
@end
@@ -55,6 +53,7 @@
{
var cell = [aCoder decodeObjectForKey:@"NSCell"];
[self NS_initWithCell:cell];
[self _adjustNib2CibSize];
}
return self;
+1 -2
View File
@@ -58,8 +58,6 @@
[self setEditable:[cell isEditable]];
[self setEnabled:[cell isEnabled]];
[self setContinuous:[cell isContinuous]];
[self _adjustNib2CibSize];
}
@end
@@ -76,6 +74,7 @@
{
var cell = [aCoder decodeObjectForKey:@"NSCell"];
[self NS_initWithCell:cell];
[self _adjustNib2CibSize];
}
return self;
+1
View File
@@ -56,6 +56,7 @@
{
var cell = [aCoder decodeObjectForKey:@"NSCell"];
[self NS_initWithCell:cell];
[self _adjustNib2CibSize];
}
return self;
+1 -2
View File
@@ -42,8 +42,6 @@
[self setMaximumRecents:[cell maximumRecents]];
[self setSendsWholeSearchString:[cell sendsWholeSearchString]];
[self setSendsSearchStringImmediately:[cell sendsSearchStringImmediately]];
[self _adjustNib2CibSize];
}
@end
@@ -60,6 +58,7 @@
{
var cell = [aCoder decodeObjectForKey:@"NSCell"];
[self NS_initWithCell:cell];
[self _adjustNib2CibSize];
}
return self;
+1 -2
View File
@@ -44,8 +44,6 @@
_altIncrementValue = [cell altIncrementValue];
[self setSliderType:[cell sliderType]];
[self _adjustNib2CibSize];
}
@end
@@ -62,6 +60,7 @@
{
var cell = [aCoder decodeObjectForKey:@"NSCell"];
[self NS_initWithCell:cell];
[self _adjustNib2CibSize];
var frame = [self frame];
+1 -2
View File
@@ -42,8 +42,6 @@
self._valueWraps = [cell valueWraps];
self._autorepeat = [cell autorepeat];
self._objectValue = [cell objectValue];
[self _adjustNib2CibSize];
}
@end
@@ -58,6 +56,7 @@
{
var cell = [aCoder decodeObjectForKey:@"NSCell"];
[self NS_initWithCell:cell];
[self _adjustNib2CibSize];
}
return self;
+1 -2
View File
@@ -65,8 +65,6 @@
if ([self formatter])
CPLog.debug(">> Formatter: " + [[self formatter] description]);
[self _adjustNib2CibSize];
}
@end
@@ -81,6 +79,7 @@
{
var cell = [aCoder decodeObjectForKey:@"NSCell"];
[self NS_initWithCell:cell];
[self _adjustNib2CibSize];
}
return self;