<bug-13916.diff>
https://savannah.gnu.org/bugs/?13916
mainly wondering about theming, we could use the normal white
background and just use the disabledControlTextColor
or hard code the lightGray color (i'd prefer not to for themeing)
or add another named color (extension disabledControlColor or
disabledTextFieldColor something)
or other comments on the patch...
Index: NSTextFieldCell.m
===================================================================
--- NSTextFieldCell.m (revision 24224)
+++ NSTextFieldCell.m (working copy)
@@ -192,6 +192,13 @@
[_background_color set];
NSRectFill ([self drawingRectForBounds: cellFrame]);
}
+
+ if (![self isEnabled])
+ {
+ [[NSColor lightGrayColor] set];
+ NSRectFill ([self drawingRectForBounds: cellFrame]);
+ }
+
[super drawInteriorWithFrame: cellFrame inView: controlView];
}
Index: NSCell.m
===================================================================
--- NSCell.m (revision 24224)
+++ NSCell.m (working copy)
@@ -1894,8 +1894,29 @@
{
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;
_______________________________________________
Gnustep-dev mailing list
[email protected]
http://lists.gnu.org/mailman/listinfo/gnustep-dev