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:
Fred Kiefer 2004-02-11 00:01:20 +00:00
parent 6b59a4f9c8
commit b29ad3d33a
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>
* Headers/AppKit/NSFont.h: Add cachedScreenFont ivar.

View file

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

View file

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