From 06346b13769c312d7b3b801a8fe64b788752a69c Mon Sep 17 00:00:00 2001 From: "joshmoz%gmail.com" Date: Wed, 20 Oct 2004 20:30:43 +0000 Subject: [PATCH] fix bug 241093 - icon in preferences dialog for current category should appear selected --- .../src/preferences/MVPreferencesController.mm | 17 ++++++++++++++++- 1 file changed, 16 insertions(+), 1 deletion(-) diff --git a/camino/src/preferences/MVPreferencesController.mm b/camino/src/preferences/MVPreferencesController.mm index a03a3be8e1a..442a6501473 100644 --- a/camino/src/preferences/MVPreferencesController.mm +++ b/camino/src/preferences/MVPreferencesController.mm @@ -124,7 +124,6 @@ NSString *MVPreferencesWindowNotification = @"MVPreferencesWindowNotification"; [multiView setPreferencePanes:panes]; mainView = multiView; } - [self showAll:nil]; [window setDelegate:self]; @@ -180,6 +179,8 @@ NSString *MVPreferencesWindowNotification = @"MVPreferencesWindowNotification"; [window setInitialFirstResponder:mainView]; [window makeFirstResponder:mainView]; + if ([NSToolbar instancesRespondToSelector:@selector(setSelectedItemIdentifier:)]) + [[window toolbar] setSelectedItemIdentifier:MVToolbarShowAllItemIdentifier]; } - (void) selectPreferencePaneByIdentifier:(NSString *) identifier @@ -235,6 +236,8 @@ NSString *MVPreferencesWindowNotification = @"MVPreferencesWindowNotification"; [window setInitialFirstResponder:[pane initialKeyView]]; [window makeFirstResponder:[pane initialKeyView]]; + if ([NSToolbar instancesRespondToSelector:@selector(setSelectedItemIdentifier:)]) + [[window toolbar] setSelectedItemIdentifier:currentPaneIdentifier]; } else { NSRunCriticalAlertPanel( NSLocalizedString( @"Preferences Error", nil ), @@ -318,6 +321,18 @@ NSString *MVPreferencesWindowNotification = @"MVPreferencesWindowNotification"; return items; } +// For OS X 10.3, set the selectable toolbar items (draws a gray rect around the active icon in the toolbar) +- (NSArray *) toolbarSelectableItemIdentifiers:(NSToolbar *)toolbar +{ + NSMutableArray* items = [NSMutableArray array]; + NSEnumerator* enumerator = [panes objectEnumerator]; + id item = nil; + while ( ( item = [enumerator nextObject] ) ) + [items addObject:[item bundleIdentifier]]; + [items addObject:MVToolbarShowAllItemIdentifier]; + return items; +} + @end @implementation MVPreferencesController (MVPreferencesControllerPrivate)