Eliminated the build warning, and made the menu icon a little smaller.
authorMatthew Judy <mjudy@ithinksw.com>
Tue, 17 Dec 2002 05:04:37 +0000 (05:04 +0000)
committerMatthew Judy <mjudy@ithinksw.com>
Tue, 17 Dec 2002 05:04:37 +0000 (05:04 +0000)
KeyCombo.m
MenuInverted.tiff
MenuNormal.tiff
MenuTunes.m

index 716d4ae..5248197 100755 (executable)
 }
 
 - (id)initWithCoder:(NSCoder *)aDecoder
-{      
-    self = [self init];
-    
-    if( self )
-    {
+{
+    if ( (self = [super init]) ) {
         [aDecoder decodeValueOfObjCType: @encode(short) at: &mKeyCode];
         [aDecoder decodeValueOfObjCType: @encode(long) at: &mModifiers];
     }
@@ -74,9 +71,9 @@
 
 - (BOOL)isEqual:(KeyCombo *)object
 {
-    return ([object isKindOfClass:[KeyCombo class]]) &&
-           ([object keyCode] == [self keyCode]) &&
-           ([object modifiers] == [self modifiers]);
+    return ( ([object isKindOfClass:[KeyCombo class]]) &&
+             ([object keyCode] == [self keyCode])      &&
+             ([object modifiers] == [self modifiers]) );
 }
 
 - (NSString *)description
 
 - (NSString *)userDisplayRep
 {
-    if ([self isValid] == NO)
-    {
+    if ( ! [self isValid] ) {
         return @"None";
-    }
-    else
-    {
+    } else {
         return [NSString stringWithFormat: @"%@%@",
             [KeyCombo _stringForModifiers: mModifiers],
             [KeyCombo _stringForKeyCode: mKeyCode]];
 
 + (NSString *)_stringForModifiers: (long)modifiers
 {
-    static long modToChar[4][2] =
-    {
+    static long modToChar[4][2] = {
             { cmdKey,  0x23180000 },
             { optionKey,       0x23250000 },
             { controlKey,      0x005E0000 },
     NSString *charStr;
     long i;
     
-    for (i = 0; i < 4; i++)
-    {
-        if (modifiers & modToChar[i][0])
-        {
+    for (i = 0; i < 4; i++) {
+        if (modifiers & modToChar[i][0]) {
             charStr = [NSString stringWithCharacters:(const unichar *)&modToChar[i][1] length:1];
             str = [str stringByAppendingString:charStr];
         }
        dict = [self keyCodesDictionary];
        key = [NSString stringWithFormat: @"%d", keyCode];
        str = [dict objectForKey: key];
-       
-       if( !str )
+
+    if( !str ) {
                str = [NSString stringWithFormat: @"%X", keyCode];
+    }
        
        return str;
 }
 {
     static NSDictionary *keyCodes = nil;
     
-    if (keyCodes == nil)
-    {
+    if (keyCodes == nil) {
         NSString *path;
         NSString *contents;
         
 - (void)setKeyCombo:(KeyCombo *)combo forKey:(NSString *)key
 {
     NSData *data;
-    if (combo)
-    {
+    if (combo) {
         data = [NSArchiver archivedDataWithRootObject:combo];
-    }
-    else
-    {
+    } else {
         data = nil;
     }
     [self setObject:data forKey:key];
 {
     NSData *data = [self objectForKey:key];
     KeyCombo *combo;
-    if (data)
-    {
-        combo =  [[NSUnarchiver unarchiveObjectWithData:data] retain];
-    }
     
-    if (combo == nil)
-    {
+    if (data) {
+        combo = [[NSUnarchiver unarchiveObjectWithData:data] retain];
+    } else {
         combo = [[KeyCombo alloc] init];
     }
+    
     return combo;
 }
 
index 01aef69..5245dd4 100755 (executable)
Binary files a/MenuInverted.tiff and b/MenuInverted.tiff differ
index f8b2d9a..4244771 100755 (executable)
Binary files a/MenuNormal.tiff and b/MenuNormal.tiff differ
index 0b25dc9..4c68648 100755 (executable)
@@ -59,7 +59,7 @@ Things to do:
     }
 
     statusItem = [[ITStatusItem alloc] initWithStatusBar:[NSStatusBar systemStatusBar]
-                                              withLength:NSVariableStatusItemLength];
+                                              withLength:NSSquareStatusItemLength];
     
     [statusItem setImage:[NSImage imageNamed:@"menu"]];
     [statusItem setAlternateImage:[NSImage imageNamed:@"selected_image"]];