diff --git a/macosx/BarButton.h b/macosx/BarButton.h index c17fc33cc..f88379838 100644 --- a/macosx/BarButton.h +++ b/macosx/BarButton.h @@ -24,7 +24,7 @@ #import -@interface BarButton : NSImageView +@interface BarButton : NSButton { NSImage * fButtonNormal, * fButtonNormalDim, * fButtonOver, * fButtonPressed, * fButtonSelected, * fButtonSelectedDim; @@ -33,7 +33,6 @@ NSTrackingRectTag fTrackingTag; } -- (void) setText: (NSString *) text; - (void) setEnabled: (BOOL) enable; - (void) resetBounds: (NSNotification *) notification; diff --git a/macosx/BarButton.m b/macosx/BarButton.m index 6e140c8f5..34a9bb9e6 100644 --- a/macosx/BarButton.m +++ b/macosx/BarButton.m @@ -24,6 +24,12 @@ #import "BarButton.h" +@interface BarButton (Private) + +- (void) setText; + +@end + @implementation BarButton //height of button should be 17.0 @@ -93,26 +99,22 @@ //selected and dimmed button fButtonSelectedDim = [fButtonSelected copy]; + [self setText]; + + [self setImage: fButtonNormal]; + [self setAlternateImage: fButtonPressed]; + [[NSNotificationCenter defaultCenter] addObserver: self selector: @selector(resetBounds:) name: NSViewBoundsDidChangeNotification object: nil]; } return self; } -- (void) dealloc -{ - [fButtonNormal release]; - [fButtonOver release]; - [fButtonPressed release]; - [fButtonSelected release]; - [fButtonSelectedDim release]; - - [super dealloc]; -} - //call only once to avoid overlapping text -- (void) setText: (NSString *) text +- (void) setText { + NSString * text = [self title]; + NSFont * boldFont = [[NSFontManager sharedFontManager] convertFont: [NSFont fontWithName: @"Lucida Grande" size: 12.0] toHaveTrait: NSBoldFontMask]; @@ -192,14 +194,23 @@ [text drawInRect: textRect withAttributes: highlightedDimAttributes]; [fButtonSelectedDim unlockFocus]; - [self setImage: fButtonNormal]; - [normalAttributes release]; [normalDimAttributes release]; [highlightedAttributes release]; [highlightedDimAttributes release]; } +- (void) dealloc +{ + [fButtonNormal release]; + [fButtonOver release]; + [fButtonPressed release]; + [fButtonSelected release]; + [fButtonSelectedDim release]; + + [super dealloc]; +} + - (void) mouseEntered: (NSEvent *) event { if (!fEnabled) @@ -216,7 +227,7 @@ [super mouseExited: event]; } -- (void) mouseDown: (NSEvent *) event +/*- (void) mouseDown: (NSEvent *) event { [self setImage: fButtonPressed]; @@ -228,7 +239,7 @@ [NSApp sendAction: [self action] to: [self target] from: self]; [self setImage: fEnabled ? fButtonSelected : fButtonOver]; -} +}*/ - (void) setEnabled: (BOOL) enable { diff --git a/macosx/Controller.m b/macosx/Controller.m index d0aa571da..c25c18598 100644 --- a/macosx/Controller.m +++ b/macosx/Controller.m @@ -249,12 +249,6 @@ static void sleepCallBack(void * controller, io_service_t y, natural_t messageTy //set filter fFilterType = [[fDefaults stringForKey: @"Filter"] retain]; - //button width should be 9 pixels surrounding text length - [fNoFilterButton setText: @"All"]; //16.64 - [fDownloadFilterButton setText: @"Downloading"]; //81.69 - [fSeedFilterButton setText: @"Seeding"]; //48.57 - [fPauseFilterButton setText: @"Paused"]; //44.06 - BarButton * currentFilterButton; if ([fFilterType isEqualToString: @"Pause"]) currentFilterButton = fPauseFilterButton; diff --git a/macosx/English.lproj/MainMenu.nib/classes.nib b/macosx/English.lproj/MainMenu.nib/classes.nib index 12093b166..5b7fffb8b 100644 --- a/macosx/English.lproj/MainMenu.nib/classes.nib +++ b/macosx/English.lproj/MainMenu.nib/classes.nib @@ -1,6 +1,6 @@ { IBClasses = ( - {CLASS = BarButton; LANGUAGE = ObjC; SUPERCLASS = NSImageView; }, + {CLASS = BarButton; LANGUAGE = ObjC; SUPERCLASS = NSButton; }, { ACTIONS = { applyFilter = id; diff --git a/macosx/English.lproj/MainMenu.nib/info.nib b/macosx/English.lproj/MainMenu.nib/info.nib index 415d22dd4..d855b7fea 100644 --- a/macosx/English.lproj/MainMenu.nib/info.nib +++ b/macosx/English.lproj/MainMenu.nib/info.nib @@ -11,7 +11,7 @@ 1480 366 546 420 63 0 0 1152 842 1603 - 360 371 477 67 0 0 1152 842 + 337 544 477 67 0 0 1152 842 29 9 780 451 44 0 0 1152 842 456 @@ -31,7 +31,7 @@ 3 IBOpenObjects - 1480 + 1603 29 21 diff --git a/macosx/English.lproj/MainMenu.nib/keyedobjects.nib b/macosx/English.lproj/MainMenu.nib/keyedobjects.nib index c19183d3c..da18b5acf 100644 Binary files a/macosx/English.lproj/MainMenu.nib/keyedobjects.nib and b/macosx/English.lproj/MainMenu.nib/keyedobjects.nib differ diff --git a/macosx/InfoWindowController.m b/macosx/InfoWindowController.m index b2fc3aa75..bf7713f77 100644 --- a/macosx/InfoWindowController.m +++ b/macosx/InfoWindowController.m @@ -422,8 +422,7 @@ NSIndexSet * indexSet = [fFileTable selectedRowIndexes]; unsigned int i; for (i = [indexSet firstIndex]; i != NSNotFound; i = [indexSet indexGreaterThanIndex: i]) - [[NSWorkspace sharedWorkspace] selectFile: [fFiles objectAtIndex: i] - inFileViewerRootedAtPath: nil]; + [[NSWorkspace sharedWorkspace] selectFile: [fFiles objectAtIndex: i] inFileViewerRootedAtPath: nil]; } - (void) setRatioCheck: (id) sender