mirror of
https://github.com/cappuccino/cappuccino.git
synced 2026-09-02 18:33:34 +00:00
When a textField is used in a tableView, setValue forThemeAttribute should refer to state CPThemeStateTableDataView instead of CPThemeStateNormal as #2744 is now more accurate on states.
This commit is contained in:
committed by
Martin Carlberg
parent
dd68b37a2a
commit
8a3eb0d83b
@@ -163,3 +163,20 @@ CPCheckBoxImageOffset = 4.0;
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
#pragma mark -
|
||||
|
||||
@implementation CPCheckBox (TableDataView)
|
||||
|
||||
// We overide here _CPObject+Theme setValue:forThemeAttribute as CPCheckBox can be used as tableView data view
|
||||
// So, when outside a table data view, setValue:forThemeAttribute should store the value with the CPThemeStateNormal (default behavior)
|
||||
// When inside a table data view, it should store the value with the CPThemeStateTableDataView. If not, the value won't be used if the
|
||||
// theme defined a value for this attribute for state CPThemeStateTableDataView
|
||||
|
||||
- (void)setValue:(id)aValue forThemeAttribute:(CPString)aName
|
||||
{
|
||||
[super setValue:aValue forThemeAttribute:aName];
|
||||
[super setValue:aValue forThemeAttribute:aName inState:CPThemeStateTableDataView];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
@@ -2217,3 +2217,22 @@ var CPTextFieldIsEditableKey = "CPTextFieldIsEditableKey",
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
#pragma mark -
|
||||
|
||||
@implementation CPTextField (TableDataView)
|
||||
|
||||
// We overide here _CPObject+Theme setValue:forThemeAttribute as CPTextField can be used as tableView data view
|
||||
// So, when outside a table data view, setValue:forThemeAttribute should store the value with the CPThemeStateNormal (default behavior)
|
||||
// When inside a table data view, it should store the value with the CPThemeStateTableDataView. If not, the value won't be used if the
|
||||
// theme defined a value for this attribute for state CPThemeStateTableDataView
|
||||
|
||||
- (void)setValue:(id)aValue forThemeAttribute:(CPString)aName
|
||||
{
|
||||
[super setValue:aValue forThemeAttribute:aName];
|
||||
[super setValue:aValue forThemeAttribute:aName inState:CPThemeStateTableDataView];
|
||||
}
|
||||
|
||||
@end
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user