allow using regular, small and mini sizes from xCode and from code using setControlSize method. Available on CPTextField, CPStepper, CPDatePicker only for the moment

This commit is contained in:
Christophe Serafin
2014-08-05 17:34:58 -07:00
parent 12c427a9cf
commit 5feac3a7ff
39 changed files with 182 additions and 63 deletions
+16 -1
View File
@@ -141,7 +141,6 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
// NS-style Display Properties
CPTextFieldBezelStyle _bezelStyle;
BOOL _isBordered;
CPControlSize _controlSize;
}
+ (Class)_binderClassForBinding:(CPString)aBinding
@@ -228,6 +227,22 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
};
}
- (void)setControlSize:(CPControlSize)aControlSize
{
[super setControlSize:aControlSize];
var frameSize = [self frameSize],
maxSize = [self currentValueForThemeAttribute:@"max-size"],
font = [self currentValueForThemeAttribute:@"font"];
if (maxSize.height > 0)
frameSize.height = maxSize.height;
[self setFrameSize:frameSize];
[self setFont:[CPFont systemFontForControlSize:[self controlSize]]];
}
#if PLATFORM(DOM)
- (DOMElement)_inputElement
{