diff --git a/ChangeLog b/ChangeLog index a2fb25a01..d26b80173 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,10 @@ +2006-12-28 Matt Rice + + * Source/NSTextFieldCell.m (-drawInteriorWithFrame:): Draw disabled + cell background with controlBackgroundColor. + * Source/NSCell.m (-drawInteriorWithFrame:): Draw disabled cell text + with disabledControlTextColor. + 2006-12-27 Richard Frith-Macdoanld * Headers/Additions/GNUstepGUI/GSTheme.h: Store images in dictionary. diff --git a/Source/NSCell.m b/Source/NSCell.m index e2db02262..c73087897 100644 --- a/Source/NSCell.m +++ b/Source/NSCell.m @@ -1894,8 +1894,31 @@ static NSColor *shadowCol; { case NSTextCellType: { - [self _drawAttributedText: [self attributedStringValue] - inFrame: cellFrame]; + if (!_cell.is_disabled) + { + [self _drawAttributedText: [self attributedStringValue] + inFrame: cellFrame]; + } + else + { + NSAttributedString *attrStr = [self attributedStringValue]; + NSDictionary *attribs; + NSMutableDictionary *newAttribs; + + attribs = [attrStr attributesAtIndex: 0 + effectiveRange: NULL]; + newAttribs = [NSMutableDictionary + dictionaryWithDictionary: attribs]; + [newAttribs setObject: [NSColor disabledControlTextColor] + forKey: NSForegroundColorAttributeName]; + + attrStr = [[NSAttributedString alloc] + initWithString: [attrStr string] + attributes: newAttribs]; + [self _drawAttributedText: attrStr + inFrame: cellFrame]; + RELEASE(attrStr); + } } break; diff --git a/Source/NSTextFieldCell.m b/Source/NSTextFieldCell.m index 615878ebf..e7a69cf5d 100644 --- a/Source/NSTextFieldCell.m +++ b/Source/NSTextFieldCell.m @@ -189,9 +189,17 @@ static NSColor *txtCol; { if (_textfieldcell_draws_background) { - [_background_color set]; + if ([self isEnabled]) + { + [_background_color set]; + } + else + { + [[NSColor controlBackgroundColor] set]; + } NSRectFill ([self drawingRectForBounds: cellFrame]); } + [super drawInteriorWithFrame: cellFrame inView: controlView]; }