-
Notifications
You must be signed in to change notification settings - Fork 9
/
SFRankCell.m
44 lines (28 loc) · 945 Bytes
/
SFRankCell.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
//
// SFRankCell.m
// SilverFlow
//
// Created by Julius Eckert on 26.01.08.
// Copyright 2008 Julius Eckert. All rights reserved.
//
#import "SFRankCell.h"
@implementation SFRankCell
- (id)initImageCell:(NSImage *)anImage {
if (self = [super initImageCell:anImage]) {
}
return self;
}
- (void)drawInteriorWithFrame:(NSRect)cellFrame inView:(NSView *)controlView {
NSBezierPath *roundRect = [NSBezierPath bezierPath];
[roundRect appendBezierPathWithRoundedRectangle:cellFrame withRadius:NSHeight(cellFrame) /2];
float size = MIN(NSHeight(cellFrame), NSWidth(cellFrame) );
NSRect drawRect = centerRectInRect(NSMakeRect(0, 0, size*1/3, size*1/3), cellFrame);
NSBezierPath *path = [NSBezierPath bezierPathWithOvalInRect:drawRect];
[[NSColor whiteColor] set];
[[NSBezierPath bezierPathWithOvalInRect:NSInsetRect(drawRect, -1, -1)] fill];
if (order != 0) {
[[NSColor grayColor] set];
[path fill];
}
}
@end