aboutsummaryrefslogtreecommitdiff
path: root/Flat Bezel/BBBackgroundView.m
diff options
context:
space:
mode:
authorRuben Beltran del Rio <ruben@unlimited.pizza>2023-02-08 16:45:16 +0100
committerRuben Beltran del Rio <ruben@unlimited.pizza>2023-02-08 16:45:16 +0100
commit5200836d4b4ca9baf0f578f7a462f27d155abff4 (patch)
treed190f2782c4b0f160faaaf1226e2de7561001272 /Flat Bezel/BBBackgroundView.m
Initial Commit
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