mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-10-09 10:20:59 +00:00
Fixed: Enable CPTextField to have a specific height
When setting controlSize, CPTextfield height was forced to min-size height. Now we check that the frame size is between the min and the max size. It allows to constrain a CPControl to have a fixed height by specifying a min-size equivalent to the maxsize. In CPTextField case, we only have a min-size which enable us to have a specific size. Changes has been made in Aristo2 only.
This commit is contained in:
1 parent
0cafb3fac5
commit
a5283a26ab
3 files changed
+14
-4
No files matched your search
+11
-1
@@ -260,10 +260,20 @@ var CPControlBlackColor = [CPColor blackColor];
|
||||
maxSize = [self currentValueForThemeAttribute:@"max-size"];
|
||||
|
||||
if (minSize.width > 0)
|
||||
{
|
||||
frameSize.width = MAX(minSize.width, frameSize.width);
|
||||
|
||||
if (maxSize.width > 0)
|
||||
frameSize.width = MIN(maxSize.width, frameSize.width);
|
||||
}
|
||||
|
||||
if (minSize.height > 0)
|
||||
frameSize.height = minSize.height;
|
||||
{
|
||||
frameSize.height = MAX(minSize.height, frameSize.height);
|
||||
|
||||
if (maxSize.height > 0)
|
||||
frameSize.height = MIN(maxSize.height, frameSize.height);
|
||||
}
|
||||
|
||||
[self setFrameSize:frameSize];
|
||||
}
|
||||
|
||||
@@ -240,8 +240,8 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
|
||||
[self _sizeToControlSize];
|
||||
}
|
||||
|
||||
#pragma mark -
|
||||
|
||||
#pragma mark -
|
||||
|
||||
#if PLATFORM(DOM)
|
||||
- (DOMElement)_inputElement
|
||||
|
||||
@@ -374,7 +374,7 @@ var themedButtonValues = nil,
|
||||
[@"font", [CPFont boldSystemFontOfSize:11.0]],
|
||||
|
||||
[@"min-size", CGSizeMake(32.0, 20.0), CPThemeStateControlSizeSmall],
|
||||
[@"max-size", CGSizeMake(1.0, 20.0), CPThemeStateControlSizeSmall],
|
||||
[@"max-size", CGSizeMake(-1.0, 20.0), CPThemeStateControlSizeSmall],
|
||||
[@"nib2cib-adjustment-frame", CGRectMake(3.0, 4.0, -6.0, 0.0), CPThemeStateControlSizeSmall],
|
||||
|
||||
// CPThemeStateControlSizeMini
|
||||
@@ -386,7 +386,7 @@ var themedButtonValues = nil,
|
||||
|
||||
[@"min-size", CGSizeMake(32.0, 16.0), CPThemeStateControlSizeMini],
|
||||
[@"max-size", CGSizeMake(-1.0, 16.0), CPThemeStateControlSizeMini],
|
||||
[@"nib2cib-adjustment-frame", CGRectMake(1.0, 10.0, -3.0, 0.0), CPThemeStateControlSizeMini]
|
||||
[@"nib2cib-adjustment-frame", CGRectMake(1.0, 10.0, -3.0, 0.0), CPThemeStateControlSizeMini]
|
||||
];
|
||||
|
||||
[self registerThemeValues:themeValues forView:button];
|
||||
|
||||
Reference in new issue
Block a user