mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-05-31 20:40:47 +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
648fecba71
commit
b659311a03
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>
|
Tue Dec 7 10:50:00 1999 Richard Frith-Macdonald <richard@brainstorm.co.uk>
|
||||||
|
|
||||||
* Source/NSButtonCell.m: ([-drawInteriorWithFrame:inView:]) fix code
|
* Source/NSButtonCell.m: ([-drawInteriorWithFrame:inView:]) fix code
|
||||||
|
|
|
@ -1078,6 +1078,7 @@ static NSMutableDictionary *colorStrings = nil;
|
||||||
NSDebugLLog(@"NSColor", @"Gray %f\n", white_component);
|
NSDebugLLog(@"NSColor", @"Gray %f\n", white_component);
|
||||||
PSsetgray(white_component);
|
PSsetgray(white_component);
|
||||||
}
|
}
|
||||||
|
PSsetalpha(alpha_component);
|
||||||
}
|
}
|
||||||
|
|
||||||
//
|
//
|
||||||
|
|
|
@ -29,6 +29,7 @@
|
||||||
*/
|
*/
|
||||||
|
|
||||||
#include <gnustep/gui/config.h>
|
#include <gnustep/gui/config.h>
|
||||||
|
#include <AppKit/NSActionCell.h>
|
||||||
#include <AppKit/NSColorWell.h>
|
#include <AppKit/NSColorWell.h>
|
||||||
#include <AppKit/NSColor.h>
|
#include <AppKit/NSColor.h>
|
||||||
#include <AppKit/NSGraphics.h>
|
#include <AppKit/NSGraphics.h>
|
||||||
|
@ -45,6 +46,15 @@
|
||||||
[self setVersion: 1];
|
[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
|
// Instance methods
|
||||||
//
|
//
|
||||||
|
@ -89,13 +99,20 @@
|
||||||
[[NSColor controlColor] set];
|
[[NSColor controlColor] set];
|
||||||
NSRectFill(NSIntersectionRect(aRect, rect));
|
NSRectFill(NSIntersectionRect(aRect, rect));
|
||||||
|
|
||||||
/*
|
|
||||||
* Draw inner frame.
|
|
||||||
*/
|
|
||||||
aRect = NSInsetRect(aRect, 5.0, 5.0);
|
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
|
else
|
||||||
aRect = NSInsetRect(aRect, 9.0, 9.0);
|
aRect = NSInsetRect(aRect, 9.0, 9.0);
|
||||||
|
@ -145,6 +162,7 @@
|
||||||
- (void)setColor: (NSColor *)color
|
- (void)setColor: (NSColor *)color
|
||||||
{
|
{
|
||||||
ASSIGN(the_color, color);
|
ASSIGN(the_color, color);
|
||||||
|
[self display];
|
||||||
}
|
}
|
||||||
|
|
||||||
- (void)takeColorFrom: (id)sender
|
- (void)takeColorFrom: (id)sender
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue