forked from mikecsh/mbtablegrid
-
Notifications
You must be signed in to change notification settings - Fork 3
Expand file tree
/
Copy pathMBTableGridShadowView.m
More file actions
34 lines (25 loc) · 910 Bytes
/
MBTableGridShadowView.m
File metadata and controls
34 lines (25 loc) · 910 Bytes
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
//
// MBTableGridShadowView.m
// MBTableGrid
//
// Created by David Sinclair on 2016-09-15.
//
#import "MBTableGridShadowView.h"
@implementation MBTableGridShadowView
- (void)drawRect:(NSRect)dirtyRect
{
[super drawRect:dirtyRect];
NSColor *startingColor = [NSColor colorWithWhite:0.5 alpha:0.2];
NSColor *endingColor = [NSColor colorWithWhite:0.5 alpha:0.0];
NSGradient *gradient = [[NSGradient alloc] initWithStartingColor:startingColor endingColor:endingColor];
// if ([[NSApplication sharedApplication] userInterfaceLayoutDirection] == NSUserInterfaceLayoutDirectionRightToLeft) {
// [gradient drawInRect:self.bounds angle:self.orientation == MBTableHeaderHorizontalOrientation ? 90.0 : 180.0];
// } else {
[gradient drawInRect:self.bounds angle:self.orientation == MBTableHeaderHorizontalOrientation ? 90.0 : 0.0];
// }
}
- (BOOL)isFlipped
{
return YES;
}
@end