aboutsummaryrefslogtreecommitdiff
path: root/Flat Bezel/BBBackgroundView.m
diff options
context:
space:
mode:
Diffstat (limited to 'Flat Bezel/BBBackgroundView.m')
-rw-r--r--Flat Bezel/BBBackgroundView.m24
1 files changed, 24 insertions, 0 deletions
diff --git a/Flat Bezel/BBBackgroundView.m b/Flat Bezel/BBBackgroundView.m
new file mode 100644
index 0000000..7aff10b
--- /dev/null
+++ b/Flat Bezel/BBBackgroundView.m
@@ -0,0 +1,24 @@
+#import "BBBackgroundView.h"
+
+@implementation BBBackgroundView
+
+- (void)drawRect:(NSRect)rect {
+ rect = [self bounds];
+
+ NSBezierPath *roundRect = [NSBezierPath bezierPath];
+
+ [roundRect appendBezierPathWithRoundedRectangle:rect withRadius:8];
+ [roundRect addClip];
+
+ BOOL darkMode = [[NSUserDefaults standardUserDefaults] boolForKey:@"QSFlatBezelDarkMode"];
+ if (darkMode) {
+ [[NSColor colorWithRed:.1 green:.1 blue:.1 alpha:.99] set];
+ } else {
+ [[NSColor colorWithRed:1 green:1 blue:1 alpha:.99] set];
+ }
+ NSRectFill(rect);
+
+ [super drawRect:rect];
+}
+
+@end