forked from AlessandroSangiuliano/rik.theme
-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathRik.m
34 lines (28 loc) · 1.01 KB
/
Rik.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
#import "Rik.h"
#import <AppKit/AppKit.h>
#import <GNUstepGUI/GSWindowDecorationView.h>
// add this declaration to quiet the compiler
@interface Rik(RikButton)
- (NSColor*) buttonColorInCell:(NSCell*) cell forState: (GSThemeControlState) state;
@end
@implementation Rik
+ (NSColor *) controlStrokeColor
{
return RETAIN([NSColor colorWithCalibratedRed: 0.4
green: 0.4
blue: 0.4
alpha: 1]);
}
- (void) drawPathButton: (NSBezierPath*) path
in: (NSCell*)cell
state: (GSThemeControlState) state
{
NSColor *backgroundColor = [self buttonColorInCell: cell forState: state];
NSColor* strokeColorButton = [Rik controlStrokeColor];
NSGradient* buttonBackgroundGradient = [self _bezelGradientWithColor: backgroundColor];
[buttonBackgroundGradient drawInBezierPath: path angle: -90];
[strokeColorButton setStroke];
[path setLineWidth: 1];
[path stroke];
}
@end