diff options
| author | Ruben Beltran del Rio <ruben@unlimited.pizza> | 2023-02-08 16:45:16 +0100 |
|---|---|---|
| committer | Ruben Beltran del Rio <ruben@unlimited.pizza> | 2023-02-08 16:45:16 +0100 |
| commit | 5200836d4b4ca9baf0f578f7a462f27d155abff4 (patch) | |
| tree | d190f2782c4b0f160faaaf1226e2de7561001272 /Flat Bezel/BBBackgroundView.m | |
Initial Commit
Diffstat (limited to 'Flat Bezel/BBBackgroundView.m')
| -rw-r--r-- | Flat Bezel/BBBackgroundView.m | 24 |
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 |