aboutsummaryrefslogtreecommitdiff
path: root/Flat Bezel/BBBackgroundView.m
blob: 7aff10bd952cd8d2b46c631a8f549abe771a3434 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
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