-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathFluidTabView.m
69 lines (51 loc) · 1.15 KB
/
FluidTabView.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
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
//
// FluidTabView.m
// FluidApp
//
#import "FluidTabView.h"
@implementation FluidTabView
- (id)initWithFrame:(NSRect)frame {
self = [super initWithFrame:frame];
if (self) {
// Initialization code here.
}
return self;
}
- (BOOL)mouseDownCanMoveWindow
{
return NO;
}
- (void)drawRect:(NSRect)dirtyRect
{
NSRect rect = [self bounds];
rect.origin.x+=0.7f;
rect.origin.y+=1.5f;
rect.size.width -=2.5f;
rect.size.height -=0.5f;
NSBezierPath *bp = [NSBezierPath bezierPath];
[bp setLineWidth:1.0f];
NSPoint tmp = rect.origin;
tmp.x += 4.5f;
[bp moveToPoint:tmp];
tmp = rect.origin;
tmp.x += rect.size.width;
tmp.x += 1.0f;
NSPoint tmp2 = tmp;
tmp2.y += 1.0f;
[bp appendBezierPathWithArcFromPoint:tmp toPoint:tmp2 radius:5];
tmp.y += rect.size.height;
tmp2 = tmp;
tmp2.x -= 1.0f;
[bp appendBezierPathWithArcFromPoint:tmp toPoint:tmp2 radius:5];
tmp.x -= rect.size.width;
[bp lineToPoint:tmp];
tmp.y -= rect.size.height;
tmp2 = tmp;
tmp2.x += 1.0f;
[bp appendBezierPathWithArcFromPoint:tmp toPoint:tmp2 radius:5];
[[NSColor whiteColor] set];
[bp fill];
[[NSColor darkGrayColor] set];
[bp stroke];
}
@end