NSColorWell themeing

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@29594 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Eric Wasylishen 2010-02-12 23:09:35 +00:00
parent e7e2c06ef5
commit 411d3e27bc
4 changed files with 50 additions and 11 deletions

View file

@ -1,3 +1,10 @@
2010-02-12 Eric Wasylishen <ewasylishen@gmail.com>
* Headers/Additions/GNUstepGUI/GSTheme.h:
* Source/GSTheme.m:
* Source/GSThemeDrawing.m: Allow themeing NSColorWell. The part names
is GSColorWell
2010-02-12 Eric Wasylishen <ewasylishen@gmail.com>
* Source/GSThemeDrawing.m: Allow customization of window title text

View file

@ -276,6 +276,13 @@ APPKIT_EXPORT NSString *GSMenuVerticalItem;
*/
APPKIT_EXPORT NSString *GSProgressIndicatorBarDeterminate;
/*
* Color well part names.
*/
APPKIT_EXPORT NSString *GSColorWell;
/**
* This defines how the values in a tile array should be used when
* drawing a rectangle. Mostly this just effects the center, middle

View file

@ -86,6 +86,9 @@ NSString *GSMenuVerticalItem = @"GSMenuVerticalItem";
NSString *GSProgressIndicatorBarDeterminate
= @"GSProgressIndicatorBarDeterminate";
// Color well part names
NSString *GSColorWell = @"GSColorWell";
NSString *GSThemeDidActivateNotification
= @"GSThemeDidActivateNotification";
NSString *GSThemeDidDeactivateNotification

View file

@ -861,24 +861,46 @@
if ([well isBordered])
{
/*
* Draw border.
*/
[self drawButton: aRect withClip: clipRect];
GSThemeControlState state;
GSDrawTiles *tiles;
/*
* Fill in control color.
*/
if ([[well cell] isHighlighted] || [well isActive])
{
[[NSColor selectedControlColor] set];
state = GSThemeHighlightedState;
}
else
{
[[NSColor controlColor] set];
state = GSThemeNormalState;
}
aRect = NSInsetRect(aRect, 2.0, 2.0);
NSRectFill(NSIntersectionRect(aRect, clipRect));
tiles = [self tilesNamed: GSColorWell state: state];
if (tiles == nil)
{
/*
* Draw border.
*/
[self drawButton: aRect withClip: clipRect];
/*
* Fill in control color.
*/
if (state == GSThemeHighlightedState)
{
[[NSColor selectedControlColor] set];
}
else
{
[[NSColor controlColor] set];
}
aRect = NSInsetRect(aRect, 2.0, 2.0);
NSRectFill(NSIntersectionRect(aRect, clipRect));
}
else
{
aRect = [self fillRect: aRect
withTiles: tiles
background: [NSColor clearColor]];
}
/*
* Set an inset rect for the color area