-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathORBackgroundView.m
84 lines (68 loc) · 2.11 KB
/
ORBackgroundView.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
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
//
// ORBackgroundView.m
// Tumblor
//
// Created by orta on 20/07/2008.
// Copyright 2008 __MyCompanyName__. All rights reserved.
//
#import "ORViews.h"
#import <Quartz/Quartz.h>
@implementation ORBlueyBackgroundView
- (void)drawRect:(NSRect)rect {
[[NSColor colorWithDeviceRed: 0.27f green: 0.35f blue: 0.49f alpha: 1.0f] set];
NSRectFill([self bounds]);
}
@end
@implementation ORWhiteBackgroundView
- (void)drawRect:(NSRect)rect {
[[NSColor colorWithDeviceRed: 1.0f green: 1.0f blue: 1.0f alpha: 1.0f] set];
NSRectFill([self bounds]);
}
@end
@implementation ORKindaBlackBackgroundView
- (void)drawRect:(NSRect)rect {
[[NSColor colorWithDeviceRed: 0.0f green: 0.0f blue: 0.0f alpha: 0.7f] set];
NSRectFill([self bounds]);
}
@end
@implementation ORBlackBackgroundView
- (void) awakeFromNib{
_showingFilters = false;
[self setWantsLayer:true];
}
- (void) toggleFilter{
// if(_showingFilters){
// CIFilter *filter = [CIFilter filterWithName:@"CIGaussianBlur"];
// [filter setValue:[NSNumber numberWithFloat:0.0f] forKey:@"inputRadius"];
// [self setBackgroundFilters:[NSArray arrayWithObject:filter]];
// _showingFilters = false;
//
// }else{
// [NSTimer scheduledTimerWithTimeInterval:0.3 target:self selector:@selector(turnOnFilter) userInfo:nil repeats:false];
// _showingFilters = true;
// }
}
- (void)cursorUpdate:(NSEvent *)event{}
- (void)mouseEntered:(NSEvent *)theEvent{}
- (void) turnOnFilter{
// CIFilter *filter = [CIFilter filterWithName:@"CIGaussianBlur"];
// [filter setValue:[NSNumber numberWithFloat:1.0f] forKey:@"inputRadius"];
// [self setBackgroundFilters:[NSArray arrayWithObject:filter]];
[[self window] invalidateCursorRectsForView:self];
NSCursor * cursor = [NSCursor crosshairCursor];
[self addCursorRect:[self bounds] cursor:cursor];
[cursor setOnMouseEntered:true];
}
-(void)mouseDown:(NSEvent *)event{
}
- (BOOL)acceptsFirstMouse:(NSEvent *)theEvent{
return true;
}
- (BOOL)isOpaque{
return true;
}
- (void)drawRect:(NSRect)rect {
[[NSColor colorWithDeviceRed: 0.0f green: 0.0f blue: 0.0f alpha: 0.8f] set];
NSRectFill([self bounds]);
}
@end