forked from iMediaSandboxing/iMedia
-
Notifications
You must be signed in to change notification settings - Fork 1
/
IMBComboTableViewAppearance.m
57 lines (44 loc) · 1.58 KB
/
IMBComboTableViewAppearance.m
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
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
//
// IMBComboTableViewAppearance.m
// iMedia
//
// Created by Jörg Jacobsen on 29.09.12.
//
//
#import "IMBTableViewAppearance+iMediaPrivate.h"
#import "IMBComboTableViewAppearance.h"
#import "NSCell+iMedia.h"
#import "IMBComboTextCell.h"
@implementation IMBComboTableViewAppearance
@synthesize subRowTextAttributes = _subRowTextAttributes;
@synthesize subRowTextHighlightAttributes = _subRowTextHighlightAttributes;
- (void)dealloc
{
IMBRelease(_subRowTextAttributes);
IMBRelease(_subRowTextHighlightAttributes);
[super dealloc];
}
// Customizes appearance of cell according to this object's appearance properties
- (void) prepareCell:(NSCell *)inCell atColumn:(NSInteger)inColumn row:(NSInteger)inRow
{
[super prepareCell:inCell atColumn:inColumn row:inRow];
if ([inCell isKindOfClass:[IMBComboTextCell class]])
{
IMBComboTextCell *theCell = (IMBComboTextCell *) inCell;
theCell.textColor = [NSColor controlTextColor];
if ([theCell isHighlighted])
{
if (self.subRowTextHighlightAttributes) {
[theCell setSubtitleTextAttributes:self.subRowTextHighlightAttributes];
} else if (self.subRowTextAttributes){
[theCell setSubtitleTextAttributes:self.subRowTextAttributes];
}
} else { // Non-highlighted cell
if (self.subRowTextAttributes) {
[theCell setSubtitleTextAttributes:self.subRowTextAttributes];
}
}
}
}
// Draws background colors for rows according to -backgroundColors (re-iterating colors).
@end