diff --git a/ChangeLog b/ChangeLog index 4069ffb04..130a359c7 100644 --- a/ChangeLog +++ b/ChangeLog @@ -1,3 +1,11 @@ +2010-01-28 Eric Wasylishen + + * Headers/Additions/GNUstepGUI/GSTheme.h: + * Source/NSTableHeaderCell.m: + * Source/GSThemeDrawing.m: Factor out table header cell drawing into + a new GSTheme method, + -drawTableHeaderCell:withFrame:inView:state: + 2010-01-27 Eric Wasylishen * Headers/Additions/GNUstepGUI/GSTheme.h: diff --git a/Headers/Additions/GNUstepGUI/GSTheme.h b/Headers/Additions/GNUstepGUI/GSTheme.h index 5bc098b07..aa81b8a5e 100644 --- a/Headers/Additions/GNUstepGUI/GSTheme.h +++ b/Headers/Additions/GNUstepGUI/GSTheme.h @@ -238,6 +238,7 @@ @class NSMenuItemCell; @class NSMenuView; @class NSProgressIndicator; +@class NSTableHeaderCell; @class GSDrawTiles; /* First, declare names used for obtaining colors and/or tiles for specific @@ -869,7 +870,10 @@ APPKIT_EXPORT NSString *GSThemeWillDeactivateNotification; // Table drawing methods - (void) drawTableCornerView: (NSView*)cornerView withClip: (NSRect)aRect; - +- (void) drawTableHeaderCell: (NSTableHeaderCell *)cell + withFrame: (NSRect)cellFrame + inView: (NSView *)controlView + state: (GSThemeControlState)state; - (float) titlebarHeight; diff --git a/Source/GSThemeDrawing.m b/Source/GSThemeDrawing.m index 61e1886c8..c25c8c969 100644 --- a/Source/GSThemeDrawing.m +++ b/Source/GSThemeDrawing.m @@ -945,6 +945,22 @@ static NSImage *spinningImages[MaxCount]; NSRectFill(rect); } +- (void) drawTableHeaderCell: (NSTableHeaderCell *)cell + withFrame: (NSRect)cellFrame + inView: (NSView *)controlView + state: (GSThemeControlState)state +{ + if (state == GSThemeHighlightedState) + { + [self drawButton: cellFrame withClip: cellFrame]; + } + else + { + [self drawDarkButton: cellFrame withClip: cellFrame]; + } +} + + // Window decoration drawing methods /* These include the black border. */ #define TITLE_HEIGHT 23.0 diff --git a/Source/NSTableHeaderCell.m b/Source/NSTableHeaderCell.m index 9ba110cd1..915cb0ab5 100644 --- a/Source/NSTableHeaderCell.m +++ b/Source/NSTableHeaderCell.m @@ -64,15 +64,22 @@ - (void) _drawBorderAndBackgroundWithFrame: (NSRect)cellFrame inView: (NSView*)controlView { + GSThemeControlState state; if (_cell.is_highlighted == YES) { - [[GSTheme theme] drawButton: cellFrame withClip: cellFrame]; + state = GSThemeHighlightedState; } else { - [[GSTheme theme] drawDarkButton: cellFrame withClip: cellFrame]; + state = GSThemeNormalState; } + [[GSTheme theme] drawTableHeaderCell: self + withFrame: cellFrame + inView: controlView + state: state]; + + // Draw the label [self _drawBackgroundWithFrame: cellFrame inView: controlView]; }