4f9031634880a73a207f8520fb530196ef0500fd
[ITKit.git] / ITTableCornerView.m
1 #import "ITTableCornerView.h"
2
3 @implementation ITTableCornerView
4
5 - (id)initWithFrame:(NSRect)frame {
6     self = [super initWithFrame:frame];
7     if (self) {
8         headerCell = [[NSTableHeaderCell alloc] init];
9     }
10     return self;
11 }
12
13 - (void)drawRect:(NSRect)rect {
14     rect.origin.y = 0;
15     rect.size.height = 17;
16     rect.size.width += 1;
17     
18     [headerCell setState: ([[self cell] isHighlighted]) ? NSOnState : NSOffState];
19     [headerCell drawWithFrame:rect inView:nil];
20     
21     if ([self image]) {
22         [[self image] drawAtPoint:rect.origin fromRect:NSZeroRect operation:NSCompositeSourceOver fraction:1.0];
23     }
24 }
25
26 - (void)dealloc {
27     [headerCell release];
28     [super dealloc];
29 }
30
31 @end