]> git.r.bdr.sh - rbdr/Flat-Bezel.qsplugin/blob - Flat Bezel/BBBackgroundView.m
7aff10bd952cd8d2b46c631a8f549abe771a3434
[rbdr/Flat-Bezel.qsplugin] / Flat Bezel / BBBackgroundView.m
1 #import "BBBackgroundView.h"
2
3 @implementation BBBackgroundView
4
5 - (void)drawRect:(NSRect)rect {
6 rect = [self bounds];
7
8 NSBezierPath *roundRect = [NSBezierPath bezierPath];
9
10 [roundRect appendBezierPathWithRoundedRectangle:rect withRadius:8];
11 [roundRect addClip];
12
13 BOOL darkMode = [[NSUserDefaults standardUserDefaults] boolForKey:@"QSFlatBezelDarkMode"];
14 if (darkMode) {
15 [[NSColor colorWithRed:.1 green:.1 blue:.1 alpha:.99] set];
16 } else {
17 [[NSColor colorWithRed:1 green:1 blue:1 alpha:.99] set];
18 }
19 NSRectFill(rect);
20
21 [super drawRect:rect];
22 }
23
24 @end