diff --git a/AppKit/CPCheckBox.j b/AppKit/CPCheckBox.j index ab674775b..e6c29b459 100644 --- a/AppKit/CPCheckBox.j +++ b/AppKit/CPCheckBox.j @@ -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 diff --git a/AppKit/CPTextField.j b/AppKit/CPTextField.j index 00b15a227..66f6f2f56 100644 --- a/AppKit/CPTextField.j +++ b/AppKit/CPTextField.j @@ -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 + +