Some code for scroller theming

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@27498 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
Richard Frith-MacDonald 2009-01-02 12:40:07 +00:00
parent cec7464939
commit 664c7cadd2
5 changed files with 241 additions and 79 deletions

View file

@ -141,7 +141,7 @@ typedef struct _GSButtonCellFlags
- (id) init
{
[self initTextCell: @"Button"];
self = [self initTextCell: @"Button"];
return self;
}
@ -314,8 +314,8 @@ typedef struct _GSButtonCellFlags
[super setFont: fontObject];
if ((_keyEquivalentFont != nil) && (fontObject != nil) &&
((size = [fontObject pointSize]) != [_keyEquivalentFont pointSize]))
if ((_keyEquivalentFont != nil) && (fontObject != nil)
&& ((size = [fontObject pointSize]) != [_keyEquivalentFont pointSize]))
{
[self setKeyEquivalentFont: [_keyEquivalentFont fontName]
size: size];
@ -923,6 +923,21 @@ typedef struct _GSButtonCellFlags
- (void) _drawBorderAndBackgroundWithFrame: (NSRect)cellFrame
inView: (NSView*)controlView
{
/* The background color is used for borderless cells (the MacOS-X
* documentation of the NSButtonCell -backgroundColor method says
* it's only used for borderless cells).
*/
if (!_cell.is_bordered)
{
NSColor *c = [self backgroundColor];
if (c != nil)
{
[c set];
NSRectFill(cellFrame);
}
}
// Draw gradient
if (!_cell.is_highlighted)
{