mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-22 13:10:59 +00:00
* Headers/Additions/GNUstepGUI/GSTheme.h:
* Source/GSThemeDrawing.m: * Source/NSBrowser.m: * Source/NSTableHeaderCell.m: Add custom color names tableHeaderTextColor and browserHeaderTextColor for table and browser headers. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@37193 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
467edcbeef
commit
53dcd018ad
5 changed files with 56 additions and 3 deletions
|
@ -1,3 +1,12 @@
|
|||
2013-10-03 Eric Wasylishen <ewasylishen@gmail.com>
|
||||
|
||||
* Headers/Additions/GNUstepGUI/GSTheme.h:
|
||||
* Source/GSThemeDrawing.m:
|
||||
* Source/NSBrowser.m:
|
||||
* Source/NSTableHeaderCell.m: Add custom color names
|
||||
tableHeaderTextColor and browserHeaderTextColor for
|
||||
table and browser headers.
|
||||
|
||||
2013-10-03 Eric Wasylishen <ewasylishen@gmail.com>
|
||||
|
||||
* Source/NSMenuItemCell.m: If the cell is highlighted, draw
|
||||
|
|
|
@ -1087,6 +1087,8 @@ APPKIT_EXPORT NSString *GSThemeWillDeactivateNotification;
|
|||
- (void) drawProgressIndicatorBarDeterminate: (NSRect)bounds;
|
||||
|
||||
// Table drawing methods
|
||||
- (NSColor *) tableHeaderTextColorForState: (GSThemeControlState)state;
|
||||
|
||||
- (void) drawTableCornerView: (NSView*)cornerView
|
||||
withClip: (NSRect)aRect;
|
||||
- (void) drawTableHeaderCell: (NSTableHeaderCell *)cell
|
||||
|
@ -1104,6 +1106,8 @@ APPKIT_EXPORT NSString *GSThemeWillDeactivateNotification;
|
|||
state: (int)inputState
|
||||
andTitle: (NSString*)title;
|
||||
|
||||
- (NSColor *) browserHeaderTextColor;
|
||||
|
||||
- (void) drawBrowserHeaderCell: (NSTableHeaderCell*)cell
|
||||
withFrame: (NSRect)rect
|
||||
inView: (NSView*)view;
|
||||
|
|
|
@ -1388,6 +1388,23 @@ static NSImage *spinningImages[MaxCount];
|
|||
}
|
||||
|
||||
// Table drawing methods
|
||||
|
||||
- (NSColor *) tableHeaderTextColorForState: (GSThemeControlState)state
|
||||
{
|
||||
NSColor *color;
|
||||
|
||||
color = [self colorNamed: @"tableHeaderTextColor"
|
||||
state: state];
|
||||
if (color == nil)
|
||||
{
|
||||
if (state == GSThemeHighlightedState)
|
||||
color = [NSColor controlTextColor];
|
||||
else
|
||||
color = [NSColor windowFrameTextColor];
|
||||
}
|
||||
return color;
|
||||
}
|
||||
|
||||
- (void) drawTableCornerView: (NSView*)cornerView
|
||||
withClip: (NSRect)aRect
|
||||
{
|
||||
|
@ -1749,6 +1766,18 @@ static NSDictionary *titleTextAttributes[3] = {nil, nil, nil};
|
|||
}
|
||||
}
|
||||
|
||||
- (NSColor *) browserHeaderTextColor
|
||||
{
|
||||
NSColor *color;
|
||||
|
||||
color = [self colorNamed: @"browserHeaderTextColor"
|
||||
state: GSThemeNormalState];
|
||||
if (color == nil)
|
||||
{
|
||||
color = [NSColor windowFrameTextColor];
|
||||
}
|
||||
return color;
|
||||
}
|
||||
|
||||
- (void) drawBrowserHeaderCell: (NSTableHeaderCell*)cell
|
||||
withFrame: (NSRect)rect
|
||||
|
|
|
@ -205,6 +205,17 @@ static BOOL browserUseBezels;
|
|||
|
||||
@implementation GSBrowserTitleCell
|
||||
|
||||
// Default appearance of GSBrowserTitleCell
|
||||
- (id) initTextCell: (NSString *)aString
|
||||
{
|
||||
self = [super initTextCell: aString];
|
||||
if (!self)
|
||||
return nil;
|
||||
|
||||
[self setTextColor: [[GSTheme theme] browserHeaderTextColor]];
|
||||
return self;
|
||||
}
|
||||
|
||||
- (NSRect) drawingRectForBounds: (NSRect)theRect
|
||||
{
|
||||
// This adjustment must match the drawn border
|
||||
|
|
|
@ -40,7 +40,7 @@
|
|||
return nil;
|
||||
|
||||
[self setAlignment: NSCenterTextAlignment];
|
||||
[self setTextColor: [NSColor windowFrameTextColor]];
|
||||
[self setTextColor: [[GSTheme theme] tableHeaderTextColorForState: GSThemeNormalState]];
|
||||
[self setBackgroundColor: [NSColor controlShadowColor]];
|
||||
[self setDrawsBackground: YES];
|
||||
[self setFont: [NSFont titleBarFontOfSize: 0]];
|
||||
|
@ -113,12 +113,12 @@
|
|||
if (flag == YES)
|
||||
{
|
||||
[self setBackgroundColor: [NSColor controlHighlightColor]];
|
||||
[self setTextColor: [NSColor controlTextColor]];
|
||||
[self setTextColor: [[GSTheme theme] tableHeaderTextColorForState: GSThemeHighlightedState]];
|
||||
}
|
||||
else
|
||||
{
|
||||
[self setBackgroundColor: [NSColor controlShadowColor]];
|
||||
[self setTextColor: [NSColor windowFrameTextColor]];
|
||||
[self setTextColor: [[GSTheme theme] tableHeaderTextColorForState: GSThemeNormalState]];
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue