Fixes for system colors

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@4777 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
richard 1999-08-31 09:19:39 +00:00
parent 0a3131548c
commit a0c915eeb0
14 changed files with 1013 additions and 886 deletions

View file

@ -1,3 +1,32 @@
Tue Aug 31 9:45:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
Fixes to remove hard-coded colors from gui. I'm not sure this is
entirely correct - in places where we expect to display white text on
a dark-gray background, I've used windowFrameTextColor and
controlShadowColor, since the MacOS-X documentation doesn't seem to
specify anything exactly for this.
* NSBrowser.m: use windowFrameTextColor for title text and
controlShadowColor for background.
* NSClipView.m: (-init) use controlColor for default background.
* NSColorWell.m: (-drawRect:) use controlColor for background.
* NSFontPanel.m: use windowFrameTextColor for title text and
controlShadowColor for background.
* NSMatrix.m: Use controlBackgroundColor for backgrounds.
* NSMenu.m: ([NSMenuWindowTitleView drawRect:]) use windowFrameColor
and windowFrameTextColor.
* NSMenuItemCell.m: use selectedMenuItemColor or controlColor for
background, and use selectedMenuItemTextColor, controlTextColor, or
disabledControlTextColor for text.
* NSPopUpButtonCell.m: use selectedMenuItemColor or controlColor for
background, and use selectedMenuItemTextColor, controlTextColor for
text.
* NSSplitView.m: ([-initWithFrame:]) use controlShadowColor for the
divider, and controlBackgroundColor for background.
* NSTabViewItem.m: use controlBackgroundColor.
* NSTableHeaderCell.m: use controlShadowColor for header.
* NSTableView.m: use gridColor for the grid.
* NSText.m: Tidied most chunks of code using color.
Fri Aug 27 8:02:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk> Fri Aug 27 8:02:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
Patch from Nicola Pero <n.pero@mi.flashnet.it> Patch from Nicola Pero <n.pero@mi.flashnet.it>

View file

@ -188,10 +188,10 @@
return [NSBrowserCell class]; return [NSBrowserCell class];
} }
// /*
// Instance methods * Instance methods
// */
- initWithFrame: (NSRect)rect - (id) initWithFrame: (NSRect)rect
{ {
NSSize bs; NSSize bs;
NSRect scroller_rect; NSRect scroller_rect;
@ -219,7 +219,7 @@
scroller_rect.size.height = [NSScroller scrollerWidth]; scroller_rect.size.height = [NSScroller scrollerWidth];
_horizontalScroller = [[NSScroller alloc] initWithFrame: scroller_rect]; _horizontalScroller = [[NSScroller alloc] initWithFrame: scroller_rect];
[_horizontalScroller setTarget: self]; [_horizontalScroller setTarget: self];
[_horizontalScroller setAction: @selector(scrollViaScroller: )]; [_horizontalScroller setAction: @selector(scrollViaScroller:)];
[self addSubview: _horizontalScroller]; [self addSubview: _horizontalScroller];
_acceptsArrowKeys = YES; _acceptsArrowKeys = YES;
_sendsActionOnArrowKeys = YES; _sendsActionOnArrowKeys = YES;
@ -229,8 +229,8 @@
_browserColumns = [[NSMutableArray alloc] init]; _browserColumns = [[NSMutableArray alloc] init];
_titleCell = [NSTextFieldCell new]; _titleCell = [NSTextFieldCell new];
[_titleCell setEditable: NO]; [_titleCell setEditable: NO];
[_titleCell setTextColor: [NSColor whiteColor]]; [_titleCell setTextColor: [NSColor windowFrameTextColor]];
[_titleCell setBackgroundColor: [NSColor darkGrayColor]]; [_titleCell setBackgroundColor: [NSColor controlShadowColor]];
//[_titleCell setBordered: YES]; //[_titleCell setBordered: YES];
//[_titleCell setBezeled: YES]; //[_titleCell setBezeled: YES];
[_titleCell setAlignment: NSCenterTextAlignment]; [_titleCell setAlignment: NSCenterTextAlignment];
@ -295,20 +295,20 @@
BOOL both = NO; BOOL both = NO;
if (![anObject respondsToSelector: if (![anObject respondsToSelector:
@selector(browser: willDisplayCell: atRow: column: )]) @selector(browser:willDisplayCell:atRow:column:)])
[NSException raise: NSBrowserIllegalDelegateException [NSException raise: NSBrowserIllegalDelegateException
format: @"Delegate does not respond to %s\n", format: @"Delegate does not respond to %s\n",
"browser: willDisplayCell: atRow: column: "]; "browser: willDisplayCell: atRow: column: "];
if ([anObject respondsToSelector: if ([anObject respondsToSelector:
@selector(browser: numberOfRowsInColumn: )]) @selector(browser:numberOfRowsInColumn:)])
{ {
_passiveDelegate = YES; _passiveDelegate = YES;
flag = YES; flag = YES;
} }
if ([anObject respondsToSelector: if ([anObject respondsToSelector:
@selector(browser: createRowsForColumn: inMatrix: )]) @selector(browser:createRowsForColumn:inMatrix:)])
{ {
_passiveDelegate = NO; _passiveDelegate = NO;
@ -611,7 +611,7 @@
// Ask the delegate for the column title // Ask the delegate for the column title
if ([_browserDelegate respondsToSelector: if ([_browserDelegate respondsToSelector:
@selector(browser: titleOfColumn: )]) @selector(browser:titleOfColumn:)])
[self setTitle: [_browserDelegate browser: self [self setTitle: [_browserDelegate browser: self
titleOfColumn: column] titleOfColumn: column]
ofColumn: column]; ofColumn: column];
@ -786,7 +786,7 @@
// xxx Should we trigger an exception? // xxx Should we trigger an exception?
if (![_browserDelegate respondsToSelector: if (![_browserDelegate respondsToSelector:
@selector(browser: isColumnValid: )]) @selector(browser:isColumnValid:)])
return; return;
// Loop through the visible columns // Loop through the visible columns
@ -893,7 +893,7 @@
return; return;
// Notify the delegate // Notify the delegate
if ([_browserDelegate respondsToSelector: @selector(browserWillScroll: )]) if ([_browserDelegate respondsToSelector: @selector(browserWillScroll:)])
[_browserDelegate browserWillScroll: self]; [_browserDelegate browserWillScroll: self];
// Shift // Shift
@ -907,7 +907,7 @@
[self updateScroller]; [self updateScroller];
// Notify the delegate // Notify the delegate
if ([_browserDelegate respondsToSelector: @selector(browserDidScroll: )]) if ([_browserDelegate respondsToSelector: @selector(browserDidScroll:)])
[_browserDelegate browserDidScroll: self]; [_browserDelegate browserDidScroll: self];
} }
@ -922,7 +922,7 @@
return; return;
// Notify the delegate // Notify the delegate
if ([_browserDelegate respondsToSelector: @selector(browserWillScroll: )]) if ([_browserDelegate respondsToSelector: @selector(browserWillScroll:)])
[_browserDelegate browserWillScroll: self]; [_browserDelegate browserWillScroll: self];
// Shift // Shift
@ -936,7 +936,7 @@
[self updateScroller]; [self updateScroller];
// Notify the delegate // Notify the delegate
if ([_browserDelegate respondsToSelector: @selector(browserDidScroll: )]) if ([_browserDelegate respondsToSelector: @selector(browserDidScroll:)])
[_browserDelegate browserDidScroll: self]; [_browserDelegate browserDidScroll: self];
} }
@ -1039,7 +1039,7 @@
// Ask delegate if selection is ok // Ask delegate if selection is ok
if ([_browserDelegate respondsToSelector: if ([_browserDelegate respondsToSelector:
@selector(browser: selectRow: inColumn: )]) @selector(browser:selectRow:inColumn:)])
{ {
int row = [sender selectedRow]; int row = [sender selectedRow];
shouldSelect = [_browserDelegate browser: self selectRow: row shouldSelect = [_browserDelegate browser: self selectRow: row
@ -1049,7 +1049,7 @@
{ {
// Try the other method // Try the other method
if ([_browserDelegate respondsToSelector: if ([_browserDelegate respondsToSelector:
@selector(browser: selectCellWithString: inColumn: )]) @selector(browser:selectCellWithString:inColumn:)])
{ {
id c = [sender selectedCell]; id c = [sender selectedCell];
shouldSelect = [_browserDelegate browser: self shouldSelect = [_browserDelegate browser: self
@ -1595,8 +1595,8 @@
if (!_allowsMultipleSelection) if (!_allowsMultipleSelection)
[matrix setMode: NSRadioModeMatrix]; [matrix setMode: NSRadioModeMatrix];
[matrix setTarget: self]; [matrix setTarget: self];
[matrix setAction: @selector(doClick: )]; [matrix setAction: @selector(doClick:)];
[matrix setDoubleAction: @selector(doDoubleClick: )]; [matrix setDoubleAction: @selector(doDoubleClick:)];
// set new col matrix and release old // set new col matrix and release old
[bc setColumnMatrix: matrix]; [bc setColumnMatrix: matrix];
@ -1630,8 +1630,8 @@
if (!_allowsMultipleSelection) if (!_allowsMultipleSelection)
[matrix setMode: NSRadioModeMatrix]; [matrix setMode: NSRadioModeMatrix];
[matrix setTarget: self]; [matrix setTarget: self];
[matrix setAction: @selector(doClick: )]; [matrix setAction: @selector(doClick:)];
[matrix setDoubleAction: @selector(doDoubleClick: )]; [matrix setDoubleAction: @selector(doDoubleClick:)];
// set new col matrix and release old // set new col matrix and release old
[bc setColumnMatrix: matrix]; [bc setColumnMatrix: matrix];

View file

@ -36,11 +36,11 @@
@implementation NSClipView @implementation NSClipView
- init - (id) init
{ {
[super init]; [super init];
[self setAutoresizesSubviews: YES]; [self setAutoresizesSubviews: YES];
[self setBackgroundColor: [NSColor lightGrayColor]]; [self setBackgroundColor: [NSColor controlColor]];
_copiesOnScroll = YES; _copiesOnScroll = YES;
return self; return self;
} }

View file

@ -48,7 +48,7 @@
// //
// Instance methods // Instance methods
// //
- initWithFrame: (NSRect)frameRect - (id) initWithFrame: (NSRect)frameRect
{ {
[super initWithFrame: frameRect]; [super initWithFrame: frameRect];
@ -65,9 +65,9 @@
[super dealloc]; [super dealloc];
} }
// /*
// Drawing * Drawing
// */
- (void) drawRect: (NSRect)rect - (void) drawRect: (NSRect)rect
{ {
NSRect aRect = bounds; NSRect aRect = bounds;
@ -83,10 +83,10 @@
NSDrawButton(aRect, rect); NSDrawButton(aRect, rect);
/* /*
* Fill in grey. * Fill in control color.
*/ */
aRect = NSInsetRect(aRect, 2.0, 2.0); aRect = NSInsetRect(aRect, 2.0, 2.0);
[[NSColor lightGrayColor] set]; [[NSColor controlColor] set];
NSRectFill(NSIntersectionRect(aRect, rect)); NSRectFill(NSIntersectionRect(aRect, rect));
/* /*

View file

@ -51,7 +51,7 @@
NSDebugLog(@"Initialize NSFontPanel class\n"); NSDebugLog(@"Initialize NSFontPanel class\n");
// Initial version // Initial version
[self setVersion:1]; [self setVersion: 1];
} }
} }
@ -62,7 +62,7 @@
{ {
NSFontManager *fm = [NSFontManager sharedFontManager]; NSFontManager *fm = [NSFontManager sharedFontManager];
return [fm fontPanel:YES]; return [fm fontPanel: YES];
} }
// //
@ -100,82 +100,82 @@
unsigned int style = NSTitledWindowMask | NSClosableWindowMask unsigned int style = NSTitledWindowMask | NSClosableWindowMask
| NSMiniaturizableWindowMask | NSResizableWindowMask; | NSMiniaturizableWindowMask | NSResizableWindowMask;
self = [super initWithContentRect:pf self = [super initWithContentRect: pf
styleMask:style styleMask: style
backing:NSBackingStoreRetained backing: NSBackingStoreRetained
defer:NO defer: NO
screen:nil]; screen: nil];
[self setTitle:@"Font Panel"]; [self setTitle: @"Font Panel"];
v = [self contentView]; v = [self contentView];
topArea = [[NSView alloc] initWithFrame:NSMakeRect(0,50,300,250)]; topArea = [[NSView alloc] initWithFrame: NSMakeRect(0,50,300,250)];
splitView = [[NSSplitView alloc] initWithFrame:NSMakeRect(0,0,300,240)]; splitView = [[NSSplitView alloc] initWithFrame: NSMakeRect(0,0,300,240)];
[splitView setVertical:NO]; [splitView setVertical: NO];
[topArea addSubview:splitView]; [topArea addSubview: splitView];
topSplit = [[NSView alloc] initWithFrame:ts]; topSplit = [[NSView alloc] initWithFrame: ts];
previewArea = [[NSTextField alloc] initWithFrame:pa]; previewArea = [[NSTextField alloc] initWithFrame: pa];
[previewArea setBackgroundColor:[NSColor whiteColor]]; [previewArea setBackgroundColor: [NSColor textBackgroundColor]];
[previewArea setDrawsBackground:YES]; [previewArea setDrawsBackground: YES];
[topSplit addSubview:previewArea]; [topSplit addSubview: previewArea];
bottomSplit = [[NSView alloc] initWithFrame:bs]; bottomSplit = [[NSView alloc] initWithFrame: bs];
l.size.width = 110; l.size.width = 110;
label = [[NSTextField alloc] initWithFrame:l]; label = [[NSTextField alloc] initWithFrame: l];
[label setAlignment: NSCenterTextAlignment]; [label setAlignment: NSCenterTextAlignment];
[label setFont:[NSFont boldSystemFontOfSize:12]]; [label setFont: [NSFont boldSystemFontOfSize: 12]];
[label setStringValue:@"Family"]; [label setStringValue: @"Family"];
[label setEditable:NO]; [label setEditable: NO];
[label setDrawsBackground:YES]; [label setDrawsBackground: YES];
[label setTextColor:[NSColor whiteColor]]; [label setTextColor: [NSColor windowFrameTextColor]];
[label setBackgroundColor:[NSColor colorWithCalibratedWhite:NSDarkGray alpha: 1.0]]; [label setBackgroundColor: [NSColor controlShadowColor]];
[bottomSplit addSubview:label]; [bottomSplit addSubview: label];
[label release]; [label release];
ss.size.width = 110; ss.size.width = 110;
familyScroll = [[NSScrollView alloc] initWithFrame:ss]; familyScroll = [[NSScrollView alloc] initWithFrame: ss];
[familyScroll setHasVerticalScroller:YES]; [familyScroll setHasVerticalScroller: YES];
[bottomSplit addSubview:familyScroll]; [bottomSplit addSubview: familyScroll];
l.size.width = 109; l.size.width = 109;
l.origin.x = 120; l.origin.x = 120;
label = [[NSTextField alloc] initWithFrame:l]; label = [[NSTextField alloc] initWithFrame: l];
[label setFont:[NSFont boldSystemFontOfSize:12]]; [label setFont: [NSFont boldSystemFontOfSize: 12]];
[label setEditable:NO]; [label setEditable: NO];
[label setAlignment: NSCenterTextAlignment]; [label setAlignment: NSCenterTextAlignment];
[label setDrawsBackground:YES]; [label setDrawsBackground: YES];
[label setTextColor:[NSColor whiteColor]]; [label setTextColor: [NSColor windowFrameTextColor]];
[label setBackgroundColor:[NSColor darkGrayColor]]; [label setBackgroundColor: [NSColor controlShadowColor]];
[label setStringValue:@"Typeface"]; [label setStringValue: @"Typeface"];
[bottomSplit addSubview:label]; [bottomSplit addSubview: label];
[label release]; [label release];
ss.size.width = 109; ss.size.width = 109;
ss.origin.x = 120; ss.origin.x = 120;
typeScroll = [[NSScrollView alloc] initWithFrame:ss]; typeScroll = [[NSScrollView alloc] initWithFrame: ss];
[typeScroll setHasVerticalScroller:YES]; [typeScroll setHasVerticalScroller: YES];
[bottomSplit addSubview:typeScroll]; [bottomSplit addSubview: typeScroll];
l.origin.x = 231; l.origin.x = 231;
l.size.width = 58; l.size.width = 58;
label = [[NSTextField alloc] initWithFrame:l]; label = [[NSTextField alloc] initWithFrame: l];
[label setFont:[NSFont boldSystemFontOfSize:12]]; [label setFont: [NSFont boldSystemFontOfSize: 12]];
[label setAlignment: NSCenterTextAlignment]; [label setAlignment: NSCenterTextAlignment];
[label setDrawsBackground:YES]; [label setDrawsBackground: YES];
[label setEditable:NO]; [label setEditable: NO];
[label setTextColor:[NSColor whiteColor]]; [label setTextColor: [NSColor windowFrameTextColor]];
[label setBackgroundColor:[NSColor darkGrayColor]]; [label setBackgroundColor: [NSColor controlShadowColor]];
[label setStringValue:@"Size"]; [label setStringValue: @"Size"];
[bottomSplit addSubview:label]; [bottomSplit addSubview: label];
[label release]; [label release];
// last label, this is the size input. We don't release this one. // last label, this is the size input. We don't release this one.
@ -183,54 +183,54 @@
l.origin.x = 231; l.origin.x = 231;
l.origin.y = 140; l.origin.y = 140;
label = [[NSTextField alloc] initWithFrame:l]; label = [[NSTextField alloc] initWithFrame: l];
[label setDrawsBackground:YES]; [label setDrawsBackground: YES];
[label setBackgroundColor:[NSColor whiteColor]]; [label setBackgroundColor: [NSColor windowFrameTextColor]];
[bottomSplit addSubview:label]; [bottomSplit addSubview: label];
ss.origin.x = 231; ss.origin.x = 231;
ss.size.height = 138; ss.size.height = 138;
ss.size.width = 58; ss.size.width = 58;
sizeScroll = [[NSScrollView alloc] initWithFrame:ss]; sizeScroll = [[NSScrollView alloc] initWithFrame: ss];
[sizeScroll setHasVerticalScroller:YES]; [sizeScroll setHasVerticalScroller: YES];
[bottomSplit addSubview:sizeScroll]; [bottomSplit addSubview: sizeScroll];
bottomArea = [[NSView alloc] initWithFrame:NSMakeRect(0,0,300,50)]; bottomArea = [[NSView alloc] initWithFrame: NSMakeRect(0,0,300,50)];
slash = [[NSBox alloc] initWithFrame:NSMakeRect(0,40,300,2)]; slash = [[NSBox alloc] initWithFrame: NSMakeRect(0,40,300,2)];
[slash setBorderType:NSGrooveBorder]; [slash setBorderType: NSGrooveBorder];
[slash setTitlePosition:NSNoTitle]; [slash setTitlePosition: NSNoTitle];
[bottomArea addSubview:slash]; [bottomArea addSubview: slash];
[slash release]; [slash release];
revertButton = [[NSButton alloc] initWithFrame:b]; revertButton = [[NSButton alloc] initWithFrame: b];
[revertButton setStringValue:@"Revert"]; [revertButton setStringValue: @"Revert"];
[bottomArea addSubview:revertButton]; [bottomArea addSubview: revertButton];
b.origin.x = 137; b.origin.x = 137;
previewButton = [[NSButton alloc] initWithFrame:b]; previewButton = [[NSButton alloc] initWithFrame: b];
[previewButton setStringValue:@"Preview"]; [previewButton setStringValue: @"Preview"];
[previewButton setButtonType:NSOnOffButton]; [previewButton setButtonType: NSOnOffButton];
[bottomArea addSubview:previewButton]; [bottomArea addSubview: previewButton];
b.origin.x = 217; b.origin.x = 217;
setButton = [[NSButton alloc] initWithFrame:b]; setButton = [[NSButton alloc] initWithFrame: b];
[setButton setStringValue:@"Set"]; [setButton setStringValue: @"Set"];
[bottomArea addSubview:setButton]; [bottomArea addSubview: setButton];
[splitView addSubview:bottomSplit]; [splitView addSubview: bottomSplit];
[splitView addSubview:topSplit]; [splitView addSubview: topSplit];
[v addSubview:topArea]; [v addSubview: topArea];
[v addSubview:bottomArea]; [v addSubview: bottomArea];
return self; return self;
} }
- (NSFont *)panelConvertFont:(NSFont *)fontObject - (NSFont *)panelConvertFont: (NSFont *)fontObject
{ {
return panel_font; return panel_font;
} }
@ -238,8 +238,8 @@
// //
// Setting the Font // Setting the Font
// //
- (void)setPanelFont:(NSFont *)fontObject - (void)setPanelFont: (NSFont *)fontObject
isMultiple:(BOOL)flag isMultiple: (BOOL)flag
{ {
panel_font = fontObject; panel_font = fontObject;
} }
@ -257,10 +257,10 @@
return NO; return NO;
} }
- (void)setAccessoryView:(NSView *)aView - (void)setAccessoryView: (NSView *)aView
{} {}
- (void)setEnabled:(BOOL)flag - (void)setEnabled: (BOOL)flag
{} {}
- (BOOL)worksWhenModal - (BOOL)worksWhenModal
@ -271,8 +271,8 @@
// //
// Displaying the NSFontPanel // Displaying the NSFontPanel
// //
- (void)orderWindow:(NSWindowOrderingMode)place - (void)orderWindow: (NSWindowOrderingMode)place
relativeTo:(int)otherWindows relativeTo: (int)otherWindows
{} {}
- (void)display - (void)display

View file

@ -360,9 +360,9 @@ static int mouseDownFlags = 0;
cellSize = NSMakeSize(DEFAULT_CELL_WIDTH, DEFAULT_CELL_HEIGHT); cellSize = NSMakeSize(DEFAULT_CELL_WIDTH, DEFAULT_CELL_HEIGHT);
intercell = NSMakeSize(1, 1); intercell = NSMakeSize(1, 1);
[self setBackgroundColor: [NSColor lightGrayColor]]; [self setBackgroundColor: [NSColor controlBackgroundColor]];
[self setDrawsBackground: YES]; [self setDrawsBackground: YES];
[self setCellBackgroundColor: [NSColor lightGrayColor]]; [self setCellBackgroundColor: [NSColor controlBackgroundColor]];
[self setSelectionByRect: YES]; [self setSelectionByRect: YES];
[self setAutosizesCells: YES]; [self setAutosizesCells: YES];
if (mode == NSRadioModeMatrix && numRows && numCols) if (mode == NSRadioModeMatrix && numRows && numCols)

View file

@ -961,7 +961,7 @@ NSArray* array;
- (void)setMenu: (NSMenu*)aMenu { menu = aMenu; } - (void)setMenu: (NSMenu*)aMenu { menu = aMenu; }
- (NSMenu*)menu { return menu; } - (NSMenu*)menu { return menu; }
- (void)drawRect: (NSRect)rect - (void) drawRect: (NSRect)rect
{ {
NSRect floodRect = rect; NSRect floodRect = rect;
@ -971,10 +971,10 @@ NSArray* array;
floodRect.origin.y += 2; floodRect.origin.y += 2;
floodRect.size.height -= 3; floodRect.size.height -= 3;
floodRect.size.width -= 3; floodRect.size.width -= 3;
[[NSColor blackColor] set]; [[NSColor windowFrameColor] set];
NSRectFill(floodRect); NSRectFill(floodRect);
[[NSColor whiteColor] set]; [[NSColor windowFrameTextColor] set];
[[NSFont boldSystemFontOfSize:12] set]; [[NSFont boldSystemFontOfSize:12] set];
PSmoveto(rect.origin.x + 5, rect.origin.y + 6); PSmoveto(rect.origin.x + 5, rect.origin.y + 6);
PSshow([[menu title] cString]); PSshow([[menu title] cString]);

View file

@ -249,12 +249,12 @@ static BOOL usesUserKeyEquivalents = YES;
{ {
} }
- (void)drawWithFrame:(NSRect)cellFrame - (void) drawWithFrame: (NSRect)cellFrame
inView:(NSView *)controlView inView: (NSView *)controlView
{ {
NSGraphicsContext *ctxt = GSCurrentContext(); NSGraphicsContext *ctxt = GSCurrentContext();
NSRect floodRect = cellFrame; NSRect floodRect = cellFrame;
NSString *keyQ = nil; NSString *keyQ = nil;
NSDrawButton(cellFrame, cellFrame); NSDrawButton(cellFrame, cellFrame);
@ -263,18 +263,31 @@ static BOOL usesUserKeyEquivalents = YES;
floodRect.size.height -= 3; floodRect.size.height -= 3;
floodRect.size.width -= 2; floodRect.size.width -= 2;
if (cell_highlighted) { if (cell_highlighted)
[[NSColor whiteColor] set]; {
NSRectFill(floodRect); [[NSColor selectedMenuItemColor] set];
} else { }
[[NSColor lightGrayColor] set]; else
NSRectFill(floodRect); {
} [[NSColor controlColor] set];
}
NSRectFill(floodRect);
if ([self isEnabled]) if ([self isEnabled])
[[NSColor blackColor] set]; {
if (cell_highlighted)
{
[[NSColor selectedMenuItemTextColor] set];
}
else
{
[[NSColor controlTextColor] set];
}
}
else else
[[NSColor grayColor] set]; {
[[NSColor disabledControlTextColor] set];
}
[[NSFont systemFontOfSize:12] set]; [[NSFont systemFontOfSize:12] set];
DPSmoveto(ctxt, cellFrame.origin.x + 5, cellFrame.origin.y + 6); DPSmoveto(ctxt, cellFrame.origin.x + 5, cellFrame.origin.y + 6);

View file

@ -56,8 +56,8 @@
return contents; return contents;
} }
- (void)drawWithFrame:(NSRect)cellFrame - (void) drawWithFrame: (NSRect)cellFrame
inView:(NSView*)view inView: (NSView*)view
{ {
NSGraphicsContext *ctxt = GSCurrentContext(); NSGraphicsContext *ctxt = GSCurrentContext();
NSRect rect = cellFrame; NSRect rect = cellFrame;
@ -71,13 +71,15 @@
arect.origin.x += 1; arect.origin.x += 1;
arect.origin.y += 2; arect.origin.y += 2;
if (cell_highlighted) { if (cell_highlighted)
[[NSColor whiteColor] set]; {
NSRectFill(arect); [[NSColor selectedMenuItemColor] set];
} else { }
[[NSColor lightGrayColor] set]; else
NSRectFill(arect); {
} [[NSColor controlColor] set];
}
NSRectFill(arect);
if (cell_image) if (cell_image)
{ {
@ -96,7 +98,14 @@
point.x = rect.origin.x + xDist; point.x = rect.origin.x + xDist;
rect.origin = point; rect.origin = point;
[[NSColor blackColor] set]; if (cell_highlighted)
{
[[NSColor selectedMenuItemTextColor] set];
}
else
{
[[NSColor controlTextColor] set];
}
// Draw the title. // Draw the title.

View file

@ -482,7 +482,7 @@ static inline NSPoint centerSizeInRect(NSSize innerSize, NSRect outerRect)
if ([self isOpaque]) if ([self isOpaque])
{ {
[[self backgroundColor] set]; [[self backgroundColor] set];
NSRectFill(r); NSRectFill(r);
} }
/* draw the dimples */ /* draw the dimples */
@ -529,8 +529,8 @@ static inline NSPoint centerSizeInRect(NSSize innerSize, NSRect outerRect)
dividerWidth = 8; dividerWidth = 8;
draggedBarWidth = 8; draggedBarWidth = 8;
isVertical = NO; isVertical = NO;
[self setDividerColor: [NSColor darkGrayColor]]; [self setDividerColor: [NSColor controlShadowColor]];
[self setBackgroundColor: [NSColor lightGrayColor]]; [self setBackgroundColor: [NSColor controlBackgroundColor]];
[self setDimpleImage: [self setDimpleImage:
[NSImage imageNamed: @"common_Dimple.tiff"] resetDividerThickness: YES]; [NSImage imageNamed: @"common_Dimple.tiff"] resetDividerThickness: YES];
} }

View file

@ -130,18 +130,22 @@
fRect = tabRect; fRect = tabRect;
if (item_state == NSSelectedTab) { if (item_state == NSSelectedTab)
fRect.origin.y -= 1; {
fRect.size.height += 1; fRect.origin.y -= 1;
[[NSColor lightGrayColor] set]; fRect.size.height += 1;
NSRectFill(fRect); [[NSColor controlBackgroundColor] set];
} else if (item_state == NSBackgroundTab) { NSRectFill(fRect);
[[NSColor lightGrayColor] set]; }
NSRectFill(fRect); else if (item_state == NSBackgroundTab)
} else { {
[[NSColor lightGrayColor] set]; [[NSColor controlBackgroundColor] set];
NSRectFill(fRect); NSRectFill(fRect);
} }
else
{
[[NSColor controlBackgroundColor] set];
}
lRect = tabRect; lRect = tabRect;
lRect.origin.y += 3; lRect.origin.y += 3;

View file

@ -2,11 +2,11 @@
#include <AppKit/NSColor.h> #include <AppKit/NSColor.h>
@implementation NSTableHeaderCell @implementation NSTableHeaderCell
- (void)drawInteriorWithFrame:(NSRect)cellFrame - (void) drawInteriorWithFrame: (NSRect)cellFrame
inView:(NSView *)controlView inView: (NSView *)controlView
{ {
[[NSColor darkGrayColor] set]; [[NSColor controlShadowColor] set];
NSRectFill(cellFrame); NSRectFill(cellFrame);
[super drawInteriorWithFrame: cellFrame inView: controlView]; [super drawInteriorWithFrame: cellFrame inView: controlView];
} }
@end @end

View file

@ -21,7 +21,7 @@
tbv_interCellSpacing = NSMakeSize (3,2); tbv_interCellSpacing = NSMakeSize (3,2);
tbv_rowHeight = 16.0; tbv_rowHeight = 16.0;
tbv_columns = [NSMutableArray new]; tbv_columns = [NSMutableArray new];
tbv_gridColor = [NSColor grayColor]; tbv_gridColor = [NSColor gridColor];
tbv_headerView = nil; tbv_headerView = nil;
} }

File diff suppressed because it is too large Load diff