-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathFluidTabTopView.m
64 lines (48 loc) · 1.08 KB
/
FluidTabTopView.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
//
// FluidTabTopView.m
// FluidApp
//
// Created by Michael Fortin on 09-12-05.
// Copyright 2009 __MyCompanyName__. All rights reserved.
//
#import "FluidTabTopView.h"
@implementation FluidTabTopView
- (id)initWithFrame:(NSRect)frame {
self = [super initWithFrame:frame];
if (self) {
// Initialization code here.
}
return self;
}
- (BOOL)mouseDownCanMoveWindow
{
return YES;
}
- (void)drawRect:(NSRect)dirtyRect
{
NSRect rect = [self bounds];
rect.origin.x+=0.7f-2.5f;
rect.origin.y-=rect.size.height;
rect.size.height +=0.5f;
NSBezierPath *bp = [NSBezierPath bezierPath];
[bp setLineWidth:1.0f];
NSPoint tmp = rect.origin;
tmp.x += 2.5f;
[bp moveToPoint:tmp];
tmp = rect.origin;
tmp.x += rect.size.width;
tmp.x += 1.0f;
NSPoint tmp2 = tmp;
[bp lineToPoint:tmp];
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];
[[NSColor whiteColor] set];
[bp fill];
[[NSColor darkGrayColor] set];
[bp stroke];
}
@end