-
Notifications
You must be signed in to change notification settings - Fork 18
/
ContentView.m
executable file
·59 lines (43 loc) · 1.72 KB
/
ContentView.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
//
// ContentView.m
// Frenzy
//
// Created by John Winter on 21/01/11.
// Copyright 2011 Aptonic Software. All rights reserved.
//
#import "ContentView.h"
@implementation ContentView
@synthesize topImage;
- (void)awakeFromNib
{
[self setTopImage:[NSImage imageNamed:@"top.png"]];
}
- (void)drawRect:(NSRect)rect
{
[[NSColor lightGrayColor] set];
NSShadow *mainShadow = [[[NSShadow alloc] init] autorelease];
[mainShadow setShadowColor:[NSColor colorWithCalibratedRed:0 green:0 blue:0 alpha:0.8]];
[mainShadow setShadowOffset:NSMakeSize(0, 2)];
[mainShadow setShadowBlurRadius:22];
[mainShadow set];
NSRectFill(NSMakeRect(21, 18, [self frame].size.width - 43, [self frame].size.height - 73));
NSShadow *bottomShadow = [[[NSShadow alloc] init] autorelease];
[bottomShadow setShadowColor:[NSColor colorWithCalibratedRed:0 green:0 blue:0 alpha:0.3]];
[bottomShadow setShadowOffset:NSMakeSize(0, -5)];
[bottomShadow setShadowBlurRadius:22];
[bottomShadow set];
NSRectFill(NSMakeRect(18, 25, [self frame].size.width - 35, 8));
NSShadow *blankShadow = [[[NSShadow alloc] init] autorelease];
[blankShadow set];
// Left WebView border
[[NSColor colorWithDeviceRed:0 green:0 blue:0 alpha:0.35] set];
NSRect blackRect = NSMakeRect(17, 61, 1, [self frame].size.height-109);
NSRectFill(blackRect);
// Right WebView border
[[NSColor colorWithDeviceRed:0 green:0 blue:0 alpha:0.35] set];
NSRect blackRect2 = NSMakeRect(346, 61, 1, [self frame].size.height-109);
NSRectFill(blackRect2);
[topImage drawAtPoint:NSMakePoint(5, [self frame].size.height - [topImage size].height - 4) fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0];
}
- (BOOL)acceptsFirstMouse:(NSEvent *)theEvent { return YES; }
@end