forked from tomcool420/SMFramework
-
Notifications
You must be signed in to change notification settings - Fork 0
/
SMFMenuItem.m
101 lines (91 loc) · 2.13 KB
/
SMFMenuItem.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
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
//
// SMFMenuItem.m
// SMFramework
//
// Created by Thomas Cool on 10/26/10.
// Copyright 2010 tomcool.org. All rights reserved.
//
#import "SMFMenuItem.h"
#import "Backrow/AppleTV.h"
@implementation SMFMenuItem
@synthesize centered;
+(SMFMenuItem *)folderMenuItem
{
SMFMenuItem *i = [[SMFMenuItem alloc] init];
[i addAccessoryOfType:1];
return [i autorelease];
}
+(SMFMenuItem *)menuItem
{
SMFMenuItem *i = [[SMFMenuItem alloc] init];
[i addAccessoryOfType:0];
return [i autorelease];
}
+(SMFMenuItem *)shuffleMenuItem
{
SMFMenuItem *i = [[SMFMenuItem alloc] init];
[i addAccessoryOfType:3];
return [i autorelease];
}
+(SMFMenuItem *)refreshMenuItem
{
SMFMenuItem *i = [[SMFMenuItem alloc] init];
[i addAccessoryOfType:4];
return [i autorelease];
}
+(SMFMenuItem *)syncMenuItem
{
SMFMenuItem *i = [[SMFMenuItem alloc] init];
[i addAccessoryOfType:5];
return [i autorelease];
}
+(SMFMenuItem *)lockMenuItem
{
SMFMenuItem *i = [[SMFMenuItem alloc] init];
[i addAccessoryOfType:6];
return [i autorelease];
}
+(SMFMenuItem *)progressMenuItem
{
SMFMenuItem *i = [[SMFMenuItem alloc] init];
[i addAccessoryOfType:7];
return [i autorelease];
}
+(SMFMenuItem *)downloadMenuItem
{
SMFMenuItem *i = [[SMFMenuItem alloc] init];
[i addAccessoryOfType:8];
return [i autorelease];
}
+(SMFMenuItem *)computerMenuItem
{
SMFMenuItem *i = [[SMFMenuItem alloc] init];
[i addAccessoryOfType:9];
return [i autorelease];
}
-(void)setTitle:(NSString *)title
{
if (centered == TRUE)
{
[self setText:title withAttributes:[self centeredTextAttributes]];
} else {
[self setText:title withAttributes:[[BRThemeInfo sharedTheme]menuItemTextAttributes]];
}
}
-(void)setRightText:(NSString *)txt
{
[self setRightJustifiedText:txt withAttributes:[[BRThemeInfo sharedTheme] menuItemSmallTextAttributes]];
}
-(void)setSelectedImage:(BOOL)b
{
if (b) {
self.image=[[BRThemeInfo sharedTheme]selectedSettingImage];
self.imageInset=-0.0f;
self.textPadding=-0.0f;
self.imageHeight=30.0f;
}
else {
self.image=nil;
}
}
@end