Переглянути джерело

Added tooltip for cut titles

Thomas Buck 10 роки тому
джерело
коміт
7d11d26dd1

+ 2
- 0
RedditBar/AppDelegate.m Переглянути файл

165
         RedditItem *reddit = [array objectAtIndex:i];
165
         RedditItem *reddit = [array objectAtIndex:i];
166
         NSMenuItem *item = [[NSMenuItem alloc] init];
166
         NSMenuItem *item = [[NSMenuItem alloc] init];
167
         [item setTitle:reddit.name];
167
         [item setTitle:reddit.name];
168
+        if (![reddit.name isEqualToString:reddit.fullName])
169
+            [item setToolTip:reddit.fullName];
168
         if (reddit.isSelf) {
170
         if (reddit.isSelf) {
169
             [item setAction:@selector(linkToOpen:)];
171
             [item setAction:@selector(linkToOpen:)];
170
             [item setKeyEquivalent:@""];
172
             [item setKeyEquivalent:@""];

+ 1
- 0
RedditBar/Reddit.m Переглянути файл

101
             name = [NSString stringWithFormat:@"%@%@", [name substringToIndex:(maxTitleLength - [replaceTextForTitle length])], replaceTextForTitle];
101
             name = [NSString stringWithFormat:@"%@%@", [name substringToIndex:(maxTitleLength - [replaceTextForTitle length])], replaceTextForTitle];
102
         }
102
         }
103
         RedditItem *r = [RedditItem itemWithName:name Link:link Comments:comments Self:isSelf];
103
         RedditItem *r = [RedditItem itemWithName:name Link:link Comments:comments Self:isSelf];
104
+        [r setFullName:[current valueForKey:@"title"]];
104
         [array insertObject:r atIndex:i];
105
         [array insertObject:r atIndex:i];
105
     }
106
     }
106
     return array;
107
     return array;

+ 1
- 1
RedditBar/RedditBar-Info.plist Переглянути файл

21
 	<key>CFBundleSignature</key>
21
 	<key>CFBundleSignature</key>
22
 	<string>????</string>
22
 	<string>????</string>
23
 	<key>CFBundleVersion</key>
23
 	<key>CFBundleVersion</key>
24
-	<string>150</string>
24
+	<string>152</string>
25
 	<key>LSApplicationCategoryType</key>
25
 	<key>LSApplicationCategoryType</key>
26
 	<string>public.app-category.utilities</string>
26
 	<string>public.app-category.utilities</string>
27
 	<key>LSMinimumSystemVersion</key>
27
 	<key>LSMinimumSystemVersion</key>

+ 1
- 0
RedditBar/RedditItem.h Переглянути файл

11
 @interface RedditItem : NSObject
11
 @interface RedditItem : NSObject
12
 
12
 
13
 @property (atomic, retain) NSString *name;
13
 @property (atomic, retain) NSString *name;
14
+@property (atomic, retain) NSString *fullName;
14
 @property (atomic, retain) NSString *link;
15
 @property (atomic, retain) NSString *link;
15
 @property (atomic, retain) NSString *comments;
16
 @property (atomic, retain) NSString *comments;
16
 @property (atomic) BOOL isSelf;
17
 @property (atomic) BOOL isSelf;

+ 1
- 1
RedditBar/RedditItem.m Переглянути файл

10
 
10
 
11
 @implementation RedditItem
11
 @implementation RedditItem
12
 
12
 
13
-@synthesize name, link, comments, isSelf;
13
+@synthesize name, fullName, link, comments, isSelf;
14
 
14
 
15
 +(RedditItem *)itemWithName:(NSString *)name Link:(NSString *)link Comments:(NSString *)comments Self:(BOOL)isSelf {
15
 +(RedditItem *)itemWithName:(NSString *)name Link:(NSString *)link Comments:(NSString *)comments Self:(BOOL)isSelf {
16
     RedditItem *i = [[RedditItem alloc] init];
16
     RedditItem *i = [[RedditItem alloc] init];

Завантаження…
Відмінити
Зберегти