mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 22:40:48 +00:00
* Source/NSTextFieldCell.m (-drawInteriorWithFrame:): Draw disabled
cell background with controlBackgroundColor. * Source/NSCell.m (-drawInteriorWithFrame:): Draw disabled cell text with disabledControlTextColor. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@24288 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
b5e970268a
commit
aca4927b57
3 changed files with 41 additions and 3 deletions
|
@ -1,3 +1,10 @@
|
|||
2006-12-28 Matt Rice <ratmice@gmail.com>
|
||||
|
||||
* 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 <rfm@gnu.org>
|
||||
|
||||
* Headers/Additions/GNUstepGUI/GSTheme.h: Store images in dictionary.
|
||||
|
|
|
@ -1893,10 +1893,33 @@ static NSColor *shadowCol;
|
|||
switch (_cell.type)
|
||||
{
|
||||
case NSTextCellType:
|
||||
{
|
||||
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;
|
||||
|
||||
case NSImageCellType:
|
||||
|
|
|
@ -188,10 +188,18 @@ static NSColor *txtCol;
|
|||
- (void) drawInteriorWithFrame: (NSRect)cellFrame inView: (NSView*)controlView
|
||||
{
|
||||
if (_textfieldcell_draws_background)
|
||||
{
|
||||
if ([self isEnabled])
|
||||
{
|
||||
[_background_color set];
|
||||
}
|
||||
else
|
||||
{
|
||||
[[NSColor controlBackgroundColor] set];
|
||||
}
|
||||
NSRectFill ([self drawingRectForBounds: cellFrame]);
|
||||
}
|
||||
|
||||
[super drawInteriorWithFrame: cellFrame inView: controlView];
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue