Fixed: _CPThemeAttribute _parentAttribute had confusing name

Previously _CPThemeAttribute had an ivar called _parentAttribute, which represented the attribute from the theme descriptor, as opposed to the attribute for a particular instance of a view.

This commit renames that ivar to _themeDefaultAttribute, so it is clearer where it gets its values.
This commit is contained in:
Aparajita Fishman committed 2013-03-14 23:57:39 -04:00
1 parent 8055808235
commit d25ff21030
2 files changed
+6 -6

No files matched your search

+4 -4
View File
@@ -431,7 +431,7 @@ CPThemeStateKeyWindow = CPThemeState("keyWindow");
CPDictionary _values @accessors(readonly, getter=values);
JSObject _cache;
_CPThemeAttribute _parentAttribute;
_CPThemeAttribute _themeDefaultAttribute;
}
- (id)initWithName:(CPString)aName defaultValue:(id)aDefaultValue
@@ -542,7 +542,7 @@ CPThemeStateKeyWindow = CPThemeState("keyWindow");
}
if (value === undefined || value === nil)
value = [_parentAttribute valueForState:aState];
value = [_themeDefaultAttribute valueForState:aState];
if (value === undefined || value === nil)
value = _defaultValue;
@@ -554,11 +554,11 @@ CPThemeStateKeyWindow = CPThemeState("keyWindow");
- (void)setParentAttribute:(_CPThemeAttribute)anAttribute
{
if (_parentAttribute === anAttribute)
if (_themeDefaultAttribute === anAttribute)
return;
_cache = { };
_parentAttribute = anAttribute;
_themeDefaultAttribute = anAttribute;
}
- (_CPThemeAttribute)attributeMergedWithAttribute:(_CPThemeAttribute)anAttribute
+2 -2
View File
@@ -93,10 +93,10 @@
[bezelToggleField setEditable:YES];
[bezelToggleField setFrameOrigin:CGPointMake(15, 445)];
console.log("" + bezelToggleField._themeAttributes['content-inset']._parentAttribute._values);
console.log("" + bezelToggleField._themeAttributes['content-inset']._themeDefaultAttribute._values);
console.log("" + bezelToggleField._themeAttributes['content-inset']._values);
[bezelToggleField setValue:[bezelToggleField valueForThemeAttribute:@"content-inset" inState:CPThemeStateBezeled] forThemeAttribute:@"content-inset" inState:CPThemeStateNormal];
console.log("" + bezelToggleField._themeAttributes['content-inset']._parentAttribute._values);
console.log("" + bezelToggleField._themeAttributes['content-inset']._themeDefaultAttribute._values);
console.log("" + bezelToggleField._themeAttributes['content-inset']._values);
[contentView addSubview:bezelToggleField];