mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-09-22 02:10:42 +00:00
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:
+16
-1
@@ -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
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user