Permalink
Browse files

Proper fonts, proper colors.

  • Loading branch information...
1 parent 64a4b2f commit a2e6ca757dc7d10af40126d28b9d691b940c7084 @tmcw tmcw committed Nov 23, 2011
Showing with 10 additions and 7 deletions.
  1. +10 −7 xtw/XTWController.m
View
@@ -18,18 +18,18 @@ - (void)updateCount
NSMutableDictionary *menuAttributes = [NSMutableDictionary dictionary];
- [menuAttributes setObject:[NSFont fontWithName:@"Helvetica Neue"
- size:12]
+ [menuAttributes setObject:[NSFont fontWithName:@"Lucida Grande"
+ size:14]
forKey:NSFontAttributeName];
- [menuAttributes setObject:[NSColor redColor]
- forKey:NSForegroundColorAttributeName];
taskContents = [NSString stringWithContentsOfFile:pendingPath
encoding:NSASCIIStringEncoding
error:&err];
if (err) {
+ [menuAttributes setObject:[NSColor grayColor]
+ forKey:NSForegroundColorAttributeName];
statusTitle = @"install taskwarrior";
} else {
NSArray *tasks = [taskContents componentsSeparatedByCharactersInSet:[NSCharacterSet newlineCharacterSet]];
@@ -50,8 +50,12 @@ - (void)updateCount
}
}
if (overdue > 0) {
- statusTitle = [NSString stringWithFormat:@"%d (%d)", [tasks count], overdue];
+ [menuAttributes setObject:[NSColor redColor]
+ forKey:NSForegroundColorAttributeName];
+ statusTitle = [NSString stringWithFormat:@"%dx%d", [tasks count], overdue];
} else {
+ [menuAttributes setObject:[NSColor blackColor]
+ forKey:NSForegroundColorAttributeName];
statusTitle = [NSString stringWithFormat:@"%d", [tasks count]];
}
}
@@ -65,9 +69,8 @@ - (id)init
self = [super init];
if(self)
{
- pendingPath = [[NSString alloc] retain];
taskContents = [[NSString alloc] retain];
- pendingPath = [@"~/.task/pending.data" stringByExpandingTildeInPath];
+ pendingPath = [[@"~/.task/pending.data" stringByExpandingTildeInPath] retain];
menu = [[NSMenu alloc] init];
// Set up my status item

0 comments on commit a2e6ca7

Please sign in to comment.