Two more classes now have relavtive colour drawing.

git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@18576 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
FredKiefer 2004-02-11 00:01:20 +00:00
parent c37d0518fd
commit ce85a0cc0f
3 changed files with 18 additions and 10 deletions

View file

@ -1,3 +1,11 @@
2004-02-11 Fred Kiefer <FredKiefer@gmx.de>
* Source/NSMenuItemCell.m: (-drawBorderAndBackgroundWithFrame:inView:)
Let GSDrawFunctions do the border drawing. Removed caching of
colour class.
* Source/NSImageCell.m: (-drawWithFrame:inView:) Let
GSDrawFunctions do the border drawing.
2004-02-10 21:48 Alexander Malmberg <alexander@malmberg.org> 2004-02-10 21:48 Alexander Malmberg <alexander@malmberg.org>
* Headers/AppKit/NSFont.h: Add cachedScreenFont ivar. * Headers/AppKit/NSFont.h: Add cachedScreenFont ivar.

View file

@ -31,6 +31,7 @@
#include "AppKit/NSGraphics.h" #include "AppKit/NSGraphics.h"
#include "AppKit/NSImageCell.h" #include "AppKit/NSImageCell.h"
#include "AppKit/NSImage.h" #include "AppKit/NSImage.h"
#include "GNUstepGUI/GSDrawFunctions.h"
@implementation NSImageCell @implementation NSImageCell
@ -133,16 +134,16 @@
// nada // nada
break; break;
case NSImageFramePhoto: case NSImageFramePhoto:
NSDrawFramePhoto(cellFrame, NSZeroRect); [GSDrawFunctions drawFramePhoto: cellFrame : NSZeroRect];
break; break;
case NSImageFrameGrayBezel: case NSImageFrameGrayBezel:
NSDrawGrayBezel(cellFrame, NSZeroRect); [GSDrawFunctions drawGrayBezel: cellFrame : NSZeroRect];
break; break;
case NSImageFrameGroove: case NSImageFrameGroove:
NSDrawGroove(cellFrame, NSZeroRect); [GSDrawFunctions drawGroove: cellFrame : NSZeroRect];
break; break;
case NSImageFrameButton: case NSImageFrameButton:
NSDrawButton(cellFrame, NSZeroRect); [GSDrawFunctions drawButton: cellFrame : NSZeroRect];
break; break;
} }

View file

@ -41,11 +41,11 @@
#include "AppKit/NSMenu.h" #include "AppKit/NSMenu.h"
#include "AppKit/NSMenuItemCell.h" #include "AppKit/NSMenuItemCell.h"
#include "AppKit/NSMenuView.h" #include "AppKit/NSMenuView.h"
#include "GNUstepGUI/GSDrawFunctions.h"
@implementation NSMenuItemCell @implementation NSMenuItemCell
static Class colorClass = 0; /* Cache color class. */
static NSImage *arrowImage = nil; /* Cache arrow image. */ static NSImage *arrowImage = nil; /* Cache arrow image. */
@ -54,7 +54,6 @@ static NSImage *arrowImage = nil; /* Cache arrow image. */
if (self == [NSMenuItemCell class]) if (self == [NSMenuItemCell class])
{ {
[self setVersion: 2]; [self setVersion: 2];
colorClass = [NSColor class];
arrowImage = [[NSImage imageNamed: @"common_3DArrowRight"] copy]; arrowImage = [[NSImage imageNamed: @"common_3DArrowRight"] copy];
} }
} }
@ -361,11 +360,11 @@ static NSImage *arrowImage = nil; /* Cache arrow image. */
if (_cell.is_highlighted && (_highlightsByMask & NSPushInCellMask)) if (_cell.is_highlighted && (_highlightsByMask & NSPushInCellMask))
{ {
NSDrawGrayBezel(cellFrame, NSZeroRect); [GSDrawFunctions drawGrayBezel: cellFrame : NSZeroRect];
} }
else else
{ {
NSDrawButton(cellFrame, NSZeroRect); [GSDrawFunctions drawButton: cellFrame : NSZeroRect];
} }
} }
@ -548,10 +547,10 @@ static NSImage *arrowImage = nil; /* Cache arrow image. */
*/ */
if (mask & (NSChangeGrayCellMask | NSChangeBackgroundCellMask)) if (mask & (NSChangeGrayCellMask | NSChangeBackgroundCellMask))
{ {
_backgroundColor = [colorClass selectedMenuItemColor]; _backgroundColor = [NSColor selectedMenuItemColor];
} }
if (_backgroundColor == nil) if (_backgroundColor == nil)
_backgroundColor = [colorClass controlBackgroundColor]; _backgroundColor = [NSColor controlBackgroundColor];
// Set cell's background color // Set cell's background color
[_backgroundColor set]; [_backgroundColor set];