From f5837543befd727c75d9c6a99cd5d5bfec234d10 Mon Sep 17 00:00:00 2001 From: Matthew Judy Date: Tue, 17 Dec 2002 05:04:37 +0000 Subject: [PATCH] Eliminated the build warning, and made the menu icon a little smaller. --- KeyCombo.m | 54 +++++++++++++++++----------------------------- MenuInverted.tiff | Bin 15664 -> 15664 bytes MenuNormal.tiff | Bin 15644 -> 15644 bytes MenuTunes.m | 2 +- 4 files changed, 21 insertions(+), 35 deletions(-) diff --git a/KeyCombo.m b/KeyCombo.m index 716d4ae..5248197 100755 --- a/KeyCombo.m +++ b/KeyCombo.m @@ -54,11 +54,8 @@ } - (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 @@ -101,12 +98,9 @@ - (NSString *)userDisplayRep { - if ([self isValid] == NO) - { + if ( ! [self isValid] ) { return @"None"; - } - else - { + } else { return [NSString stringWithFormat: @"%@%@", [KeyCombo _stringForModifiers: mModifiers], [KeyCombo _stringForKeyCode: mKeyCode]]; @@ -115,8 +109,7 @@ + (NSString *)_stringForModifiers: (long)modifiers { - static long modToChar[4][2] = - { + static long modToChar[4][2] = { { cmdKey, 0x23180000 }, { optionKey, 0x23250000 }, { controlKey, 0x005E0000 }, @@ -127,10 +120,8 @@ 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]; } @@ -148,9 +139,10 @@ dict = [self keyCodesDictionary]; key = [NSString stringWithFormat: @"%d", keyCode]; str = [dict objectForKey: key]; - - if( !str ) + + if( !str ) { str = [NSString stringWithFormat: @"%X", keyCode]; + } return str; } @@ -159,8 +151,7 @@ { static NSDictionary *keyCodes = nil; - if (keyCodes == nil) - { + if (keyCodes == nil) { NSString *path; NSString *contents; @@ -180,12 +171,9 @@ - (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]; @@ -195,15 +183,13 @@ { 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; } diff --git a/MenuInverted.tiff b/MenuInverted.tiff index 01aef69283b7f414604871679ca591dec403b51c..5245dd47bf1e5b981f6661183176abd7df27cd8f 100755 GIT binary patch delta 370 zcmdl`wV`T*9V54)nSzmlm4UI9snKRnMnguG6ccj;19OWMT|=W}V_ieT6mwlmlQaWe z3lmG@6a#}4BQtZO$@7?ERV`69%fmFogzc$7IS#fu9 delta 350 zcmdl`wV`T*9V54anSz0lm65rXvH50CMngsw%T)8^M9VZ2U4ukZ6J0~Y6m#7~3sVE# zlw^zKR5ObdBO`Om$@7?ERg#U9l9LQg4S@;`l5r^9EYEyb4roV+p#j(q!^sPDdMEFb zC0-_U$;|<(JNX&eHglQIW1RfQ%we*Fxd_W+AebCt?lAd-Im_fZ<^n8D zKrnd?SU_WPgDK180t=nV3oK~CR+ubfWdSr>W^#d*!Q>@Y3X>05nN0p+1+h!PT4!U!&^*Mz#LCFf%FuN30-fH;`y_cMpHtx4 zyjqEu30-n?fa+3yMvl$jOcpXuE-($0U}9q8V`pbK=H=y06A}{Y78e)aDk&*>cygkt zjt)>#n1h4E1|%sWA~I7}R`#)?qT+uTmXVRU1=O$sguxnkcz9xAlG4)B7X<|co4C2T zBS1DVAOVm%kOmGA17rh`qrie9%FN6xPIple0Tvb(836%-N|4Kig@q@;y#;a)k`KU4 zpx1&G6cm2Jyeuat_X6Z*3!r~3K!E}ZNg&>bu9=aMkrSx#8%!gJ784U&1Jo>I0}3!? z2@o3;6X>=}Nl6_C$$?w|iXD)lAOl2z(Q*~p08vrVML-D&px;0V1yhx5kL&G0~y4Ebg+VS*Z^7Tj0nCs z-T8{vGCV+sR01)`xf9?{135)pFc>KI3y5JJe*qMg7qkG1fV_Sfh(SREQY$RV31oc( zVwhSGy#^>FEeZ+*WKj@X7;OG=s0_#sP(X8n)C*pPio*0P0*cBr$^c1q!9<|keIPyq Q#3ew?3KV@g`K6690EAhM4FCWD diff --git a/MenuTunes.m b/MenuTunes.m index 0b25dc9..4c68648 100755 --- a/MenuTunes.m +++ b/MenuTunes.m @@ -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"]]; -- 2.20.1