darkbutton function

This commit is contained in:
Riccardo Canalicchio 2013-12-28 17:58:51 +01:00
parent 209dfbee24
commit c2b3c815fb

View File

@ -250,4 +250,27 @@
[roundedRectanglePath setLineWidth: roundedRectangleStrokeWidth];
[roundedRectanglePath stroke];
}
- (NSRect) drawDarkButton: (NSRect)border withClip: (NSRect)clip
{
NSColor* strokeColorButton = [Rik controlStrokeColor];
NSColor* baseColor = [NSColor colorWithCalibratedRed: 0.75
green: 0.75
blue: 0.75
alpha: 1];
NSColor* baseColorLight = [baseColor highlightWithLevel: 0.6];
NSGradient* buttonBackgroundGradient = [[NSGradient alloc] initWithColorsAndLocations:
baseColorLight, 1.0,
baseColor, 0.0, nil];
CGFloat roundedRectangleStrokeWidth = 1;
NSBezierPath* roundedRectanglePath = [NSBezierPath bezierPathWithRect: border];
[buttonBackgroundGradient drawInBezierPath: roundedRectanglePath angle: -90];
[strokeColorButton setStroke];
[roundedRectanglePath setLineWidth: roundedRectangleStrokeWidth];
// [roundedRectanglePath stroke];
return border;
}
@end