mirror of
https://github.com/gnustep/libs-gui.git
synced 2025-06-02 09:10:59 +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
e6357523a4
commit
a2975a65f0
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>
|
2013-10-03 Eric Wasylishen <ewasylishen@gmail.com>
|
||||||
|
|
||||||
* Headers/Additions/GNUstepGUI/GSTheme.h:
|
* Headers/Additions/GNUstepGUI/GSTheme.h:
|
||||||
|
|
|
@ -40,6 +40,7 @@
|
||||||
#import <Foundation/NSDebug.h>
|
#import <Foundation/NSDebug.h>
|
||||||
#import <Foundation/NSScanner.h>
|
#import <Foundation/NSScanner.h>
|
||||||
|
|
||||||
|
#import "AppKit/NSBezierPath.h"
|
||||||
#import "AppKit/NSColor.h"
|
#import "AppKit/NSColor.h"
|
||||||
#import "AppKit/NSColorList.h"
|
#import "AppKit/NSColorList.h"
|
||||||
#import "AppKit/NSColorSpace.h"
|
#import "AppKit/NSColorSpace.h"
|
||||||
|
@ -1364,6 +1365,23 @@ systemColorWithName(NSString *name)
|
||||||
//
|
//
|
||||||
- (void) drawSwatchInRect: (NSRect)rect
|
- (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];
|
[self set];
|
||||||
NSRectFill(rect);
|
NSRectFill(rect);
|
||||||
}
|
}
|
||||||
|
|
|
@ -197,22 +197,6 @@ static NSString *GSColorWellDidBecomeExclusiveNotification =
|
||||||
{
|
{
|
||||||
return;
|
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];
|
[_the_color drawSwatchInRect: insideRect];
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue