mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-04-22 20:50:44 +00:00
* Source/NSColor.m:
* Source/NSColorWell.m: Move code to draw the black and white triangles background for transparent colors to -[NSColor drawSwatchInRect:]. git-svn-id: svn+ssh://svn.gna.org/svn/gnustep/libs/gui/trunk@37194 72102866-910b-0410-8b05-ffd578937521
This commit is contained in:
parent
53dcd018ad
commit
481d535880
3 changed files with 25 additions and 16 deletions
|
@ -1,3 +1,10 @@
|
|||
2013-10-04 Eric Wasylishen <ewasylishen@gmail.com>
|
||||
|
||||
* Source/NSColor.m:
|
||||
* Source/NSColorWell.m: Move code to draw the black and white
|
||||
triangles background for transparent colors to
|
||||
-[NSColor drawSwatchInRect:].
|
||||
|
||||
2013-10-03 Eric Wasylishen <ewasylishen@gmail.com>
|
||||
|
||||
* Headers/Additions/GNUstepGUI/GSTheme.h:
|
||||
|
|
|
@ -40,6 +40,7 @@
|
|||
#import <Foundation/NSDebug.h>
|
||||
#import <Foundation/NSScanner.h>
|
||||
|
||||
#import "AppKit/NSBezierPath.h"
|
||||
#import "AppKit/NSColor.h"
|
||||
#import "AppKit/NSColorList.h"
|
||||
#import "AppKit/NSColorSpace.h"
|
||||
|
@ -1364,6 +1365,23 @@ systemColorWithName(NSString *name)
|
|||
//
|
||||
- (void) drawSwatchInRect: (NSRect)rect
|
||||
{
|
||||
if ([self alphaComponent] < 1.0)
|
||||
{
|
||||
NSBezierPath *triangle = [NSBezierPath bezierPath];
|
||||
|
||||
[[NSColor whiteColor] set];
|
||||
NSRectFill(rect);
|
||||
|
||||
[triangle moveToPoint: NSMakePoint(rect.origin.x,
|
||||
rect.origin.y + rect.size.height)];
|
||||
[triangle lineToPoint: NSMakePoint(rect.origin.x + rect.size.width,
|
||||
rect.origin.y + rect.size.height)];
|
||||
[triangle lineToPoint: rect.origin];
|
||||
[triangle closePath];
|
||||
[[NSColor blackColor] set];
|
||||
[triangle fill];
|
||||
}
|
||||
|
||||
[self set];
|
||||
NSRectFill(rect);
|
||||
}
|
||||
|
|
|
@ -197,22 +197,6 @@ static NSString *GSColorWellDidBecomeExclusiveNotification =
|
|||
{
|
||||
return;
|
||||
}
|
||||
if ([_the_color alphaComponent] < 1.0)
|
||||
{
|
||||
NSBezierPath *triangle = [NSBezierPath bezierPath];
|
||||
|
||||
[[NSColor whiteColor] set];
|
||||
NSRectFill(insideRect);
|
||||
|
||||
[triangle moveToPoint: NSMakePoint(insideRect.origin.x,
|
||||
insideRect.origin.y + insideRect.size.height)];
|
||||
[triangle lineToPoint: NSMakePoint(insideRect.origin.x + insideRect.size.width,
|
||||
insideRect.origin.y + insideRect.size.height)];
|
||||
[triangle lineToPoint: insideRect.origin];
|
||||
[triangle closePath];
|
||||
[[NSColor blackColor] set];
|
||||
[triangle fill];
|
||||
}
|
||||
[_the_color drawSwatchInRect: insideRect];
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in a new issue