Skip to content

Commit

Permalink
Made the color well cell draw more like ColorWell. Still a ways to go…
Browse files Browse the repository at this point in the history
…. Also adjusted spacing and made theme selection drop down menu align at the top
  • Loading branch information
Chris Marrin committed Oct 12, 2011
1 parent 7da8b84 commit 694c5b1
Show file tree
Hide file tree
Showing 3 changed files with 111 additions and 145 deletions.
37 changes: 33 additions & 4 deletions Strawberry/ColorWellCell.m
Original file line number Diff line number Diff line change
Expand Up @@ -66,16 +66,45 @@ - (id)initImageCell:(NSImage *)anImage
- (void)drawWithFrame:(NSRect)cellFrame inView:(NSView *)controlView
{
[NSGraphicsContext saveGraphicsState];
[[NSColor whiteColor] setStroke];

[[NSGraphicsContext currentContext] setShouldAntialias:NO];

cellFrame = NSInsetRect(cellFrame, 2.0, 2.0);
[[NSColor grayColor] setStroke];
[NSBezierPath strokeRect:cellFrame];

cellFrame = NSInsetRect(cellFrame, 1.0, 1.0);

// FIXME: This should really be a gradient
[[NSColor whiteColor] drawSwatchInRect:cellFrame];

cellFrame = NSInsetRect(cellFrame, 2.0, 2.0);
NSColor * color = (NSColor *)[self objectValue];
[color drawSwatchInRect:cellFrame];
[[NSColor grayColor] setStroke];
[NSBezierPath strokeRect:cellFrame];

/*
NSBezierPath * path = [NSBezierPath bezierPathWithRect:cellFrame];
[path setLineWidth:1];
[path stroke];
cellFrame = NSInsetRect(cellFrame, 2.0, 2.0);
NSColor * color = (NSColor *)[self objectValue];
cellFrame = NSInsetRect(cellFrame, 1.0, 1.0);
// FIXME: This should really be a gradient
[[NSColor whiteColor] drawSwatchInRect:cellFrame];
cellFrame = NSInsetRect(cellFrame, 4.0, 4.0);
[[NSColor grayColor] setStroke];
path = [NSBezierPath bezierPathWithRect:cellFrame];
[path stroke];
NSColor * color = (NSColor *)[self objectValue];
cellFrame = NSInsetRect(cellFrame, 1.0, 1.0);
if ( [color respondsToSelector:@selector(setFill)] )
[color drawSwatchInRect:cellFrame];

*/

[NSGraphicsContext restoreGraphicsState];
}

Expand Down
Loading

0 comments on commit 694c5b1

Please sign in to comment.