Mercurial > dwindows
changeset 1848:68f923e57542
Attempt at resetting default colors with DW_CLR_DEFAULT on Mac...
Not sure I used the correct ones for the correct controls or not....
will need to do some testing to see.
author | bsmith@81767d24-ef19-dc11-ae90-00e081727c95 |
---|---|
date | Sat, 29 Dec 2012 05:34:04 +0000 |
parents | ff80ad40a5d6 |
children | b5e1ccc76e58 |
files | mac/dw.m |
diffstat | 1 files changed, 10 insertions(+), 31 deletions(-) [+] |
line wrap: on
line diff
--- a/mac/dw.m Fri Dec 28 01:24:39 2012 +0000 +++ b/mac/dw.m Sat Dec 29 05:34:04 2012 +0000 @@ -746,8 +746,8 @@ bgcolor = [[NSColor colorWithDeviceRed: DW_RED_VALUE(input)/255.0 green: DW_GREEN_VALUE(input)/255.0 blue: DW_BLUE_VALUE(input)/255.0 alpha: 1] retain]; [bgcolor set]; NSRectFill([self bounds]); - [self setNeedsDisplay:YES]; - } + } + [self setNeedsDisplay:YES]; [orig release]; } @end @@ -8467,54 +8467,33 @@ { id cell = [object cell]; - if(fg) - { - [cell setTextColor:fg]; - } + [cell setTextColor:(fg ? fg : [NSColor controlTextColor])]; } if([object isKindOfClass:[NSTextField class]] || [object isKindOfClass:[NSButton class]]) { id cell = [object cell]; - if(bg) - { - [cell setBackgroundColor:bg]; - } + [cell setBackgroundColor:(bg ? bg : [NSColor controlColor])]; } else if([object isMemberOfClass:[DWBox class]]) { DWBox *box = object; - if(bg) - { - [box setColor:_back]; - } + [box setColor:_back]; } else if([object isKindOfClass:[NSTableView class]]) { DWContainer *cont = handle; - if(bg) - { - [cont setBackgroundColor:bg]; - } - if(fg) - { - [cont setForegroundColor:fg]; - } + [cont setBackgroundColor:(bg ? bg : [NSColor controlBackgroundColor])]; + [cont setForegroundColor:(fg ? fg : [NSColor controlTextColor])]; } else if([object isMemberOfClass:[DWMLE class]]) { DWMLE *mle = handle; - if(bg) - { - [mle setBackgroundColor:bg]; - } - if(fg) - { - NSTextStorage *ts = [mle textStorage]; - [ts setForegroundColor:fg]; - } + [mle setBackgroundColor:(bg ? bg : [NSColor controlBackgroundColor])]; + NSTextStorage *ts = [mle textStorage]; + [ts setForegroundColor:(fg ? fg : [NSColor controlTextColor])]; } return 0; }