aboutsummaryrefslogtreecommitdiff
path: root/VKPC/ShadowTextFieldCell.m
blob: 867404814ef666ae9f6c2af985c380833d1e0578 (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
25
26
27
28
29
30
31
32
33
34
35
36
37
38
//
//  ShadowTextFieldCell.m
//  VKPC
//
//  Created by Eugene on 12/2/13.
//  Copyright (c) 2013-2014 Eugene Z. All rights reserved.
//

#import "ShadowTextFieldCell.h"

static NSShadow *kShadow = nil;

@implementation ShadowTextFieldCell

+ (void)initialize {
    if (!VKPCIsYosemite) {
        kShadow = [[NSShadow alloc] init];
        [kShadow setShadowColor:[NSColor colorWithCalibratedWhite:1.f alpha:0.85f]];
        [kShadow setShadowBlurRadius:0.f];
        [kShadow setShadowOffset:NSMakeSize(0.f, -1.f)];
    }
}

- (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView {
    if (!VKPCIsYosemite) {
        [kShadow set];
    }
    [super drawInteriorWithFrame:cellFrame inView:controlView];
    
//    [[NSColor colorWithCalibratedWhite:1.0 alpha:0.0] set];
//    NSRectFillUsingOperation(cellFrame, NSCompositeSourceOver);
}

- (BOOL)isOpaque {
    return NO;
}

@end