mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-22 18:11:06 +00:00
Color patches.
git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@5403 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
19d7c90318
commit
bbd6713e06
3 changed files with 35 additions and 6 deletions
10
ChangeLog
10
ChangeLog
|
@ -1,3 +1,13 @@
|
|||
1999-12-07 Adam Fedor <fedor@gnu.org>
|
||||
|
||||
* Source/NSColorWell.m: Added ([+cellClass]) to set cell class to
|
||||
NSActionCell so that setTarget: and setAction: methods at least
|
||||
don't raise an exception. Modified ([-drawRect:]) to conform to
|
||||
OpenStep 4.2 behavior. (Patch from Jonathan Gapen
|
||||
<jagapen@offroad.chem.wisc.edu>).
|
||||
|
||||
* Source/NSColor.m (-set): Set the alpha coverage.
|
||||
|
||||
Tue Dec 7 10:50:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
|
||||
|
||||
* Source/NSButtonCell.m: ([-drawInteriorWithFrame:inView:]) fix code
|
||||
|
|
|
@ -1078,6 +1078,7 @@ static NSMutableDictionary *colorStrings = nil;
|
|||
NSDebugLLog(@"NSColor", @"Gray %f\n", white_component);
|
||||
PSsetgray(white_component);
|
||||
}
|
||||
PSsetalpha(alpha_component);
|
||||
}
|
||||
|
||||
//
|
||||
|
|
|
@ -29,6 +29,7 @@
|
|||
*/
|
||||
|
||||
#include <gnustep/gui/config.h>
|
||||
#include <AppKit/NSActionCell.h>
|
||||
#include <AppKit/NSColorWell.h>
|
||||
#include <AppKit/NSColor.h>
|
||||
#include <AppKit/NSGraphics.h>
|
||||
|
@ -45,6 +46,15 @@
|
|||
[self setVersion: 1];
|
||||
}
|
||||
|
||||
// FIXME: This is a hack. An NSColorWell shouldn't need an associated
|
||||
// cell, but without one the setTarget: and setAction: methods get passed
|
||||
// to an NSCell object by the superclass (NSControl). NSCell raises an
|
||||
// exception on these methods, but NSActionCell actually implements them.
|
||||
+ (Class)cellClass
|
||||
{
|
||||
return [NSActionCell class];
|
||||
}
|
||||
|
||||
//
|
||||
// Instance methods
|
||||
//
|
||||
|
@ -89,13 +99,20 @@
|
|||
[[NSColor controlColor] set];
|
||||
NSRectFill(NSIntersectionRect(aRect, rect));
|
||||
|
||||
/*
|
||||
* Draw inner frame.
|
||||
*/
|
||||
aRect = NSInsetRect(aRect, 5.0, 5.0);
|
||||
NSDrawGrayBezel(aRect, rect);
|
||||
|
||||
aRect = NSInsetRect(aRect, 2.0, 2.0);
|
||||
|
||||
/*
|
||||
* OpenStep 4.2 behavior is to omit the inner border for
|
||||
* non-enabled NSColorWell objects.
|
||||
*/
|
||||
if ([self isEnabled])
|
||||
{
|
||||
/*
|
||||
* Draw inner frame.
|
||||
*/
|
||||
NSDrawGrayBezel(aRect, rect);
|
||||
aRect = NSInsetRect(aRect, 2.0, 2.0);
|
||||
}
|
||||
}
|
||||
else
|
||||
aRect = NSInsetRect(aRect, 9.0, 9.0);
|
||||
|
@ -145,6 +162,7 @@
|
|||
- (void)setColor: (NSColor *)color
|
||||
{
|
||||
ASSIGN(the_color, color);
|
||||
[self display];
|
||||
}
|
||||
|
||||
- (void)takeColorFrom: (id)sender
|
||||
|
|
Loading…
Reference in a new issue