mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-09-24 11:20:42 +00:00
Fixed: setTextColor of CPTextField changed the color of the placeholder
Previously, the method setTextColor changed the color of the placeholder as well. Now it doesn't as in cocoa Test app in Test/Manual/CPTextFieldEditingStyleTest
This commit is contained in:
+18
-1
@@ -665,7 +665,10 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
|
||||
contentRect = [self contentRectForBounds:[self bounds]],
|
||||
verticalAlign = [self currentValueForThemeAttribute:"vertical-alignment"];
|
||||
|
||||
element.style.color = [[self valueForThemeAttribute:@"text-color" inState:CPThemeStateEditing] cssString];
|
||||
if ([self hasThemeState:CPTextFieldStatePlaceholder])
|
||||
element.style.color = [[self valueForThemeAttribute:@"text-color" inState:CPTextFieldStatePlaceholder] cssString];
|
||||
else
|
||||
element.style.color = [[self valueForThemeAttribute:@"text-color" inState:CPThemeStateEditing] cssString];
|
||||
|
||||
if (CPFeatureIsCompatible(CPInputSetFontOutsideOfDOM))
|
||||
element.style.font = [font cssString];
|
||||
@@ -1782,6 +1785,20 @@ CPTextFieldStatePlaceholder = CPThemeState("placeholder");
|
||||
|
||||
#pragma mark Overrides
|
||||
|
||||
/*!
|
||||
Sets the text color of the receiver.
|
||||
|
||||
@param aColor - A CPColor object.
|
||||
*/
|
||||
- (void)setTextColor:(CPColor)aColor
|
||||
{
|
||||
// We don't want to change the text-color of the placeHolder of the textField
|
||||
var placeholderColor = [self valueForThemeAttribute:@"text-color" inState:CPTextFieldStatePlaceholder];
|
||||
|
||||
[super setTextColor:aColor];
|
||||
[self setValue:placeholderColor forThemeAttribute:@"text-color" inState:CPTextFieldStatePlaceholder];
|
||||
}
|
||||
|
||||
- (void)viewDidHide
|
||||
{
|
||||
[super viewDidHide];
|
||||
|
||||
Reference in New Issue
Block a user