fix bug 241093 - icon in preferences dialog for current category should appear selected

This commit is contained in:
joshmoz%gmail.com 2004-10-20 20:30:43 +00:00
Родитель 5fb7b98791
Коммит 06346b1376
1 изменённых файлов: 16 добавлений и 1 удалений

Просмотреть файл

@ -124,7 +124,6 @@ NSString *MVPreferencesWindowNotification = @"MVPreferencesWindowNotification";
[multiView setPreferencePanes:panes]; [multiView setPreferencePanes:panes];
mainView = multiView; mainView = multiView;
} }
[self showAll:nil];
[window setDelegate:self]; [window setDelegate:self];
@ -180,6 +179,8 @@ NSString *MVPreferencesWindowNotification = @"MVPreferencesWindowNotification";
[window setInitialFirstResponder:mainView]; [window setInitialFirstResponder:mainView];
[window makeFirstResponder:mainView]; [window makeFirstResponder:mainView];
if ([NSToolbar instancesRespondToSelector:@selector(setSelectedItemIdentifier:)])
[[window toolbar] setSelectedItemIdentifier:MVToolbarShowAllItemIdentifier];
} }
- (void) selectPreferencePaneByIdentifier:(NSString *) identifier - (void) selectPreferencePaneByIdentifier:(NSString *) identifier
@ -235,6 +236,8 @@ NSString *MVPreferencesWindowNotification = @"MVPreferencesWindowNotification";
[window setInitialFirstResponder:[pane initialKeyView]]; [window setInitialFirstResponder:[pane initialKeyView]];
[window makeFirstResponder:[pane initialKeyView]]; [window makeFirstResponder:[pane initialKeyView]];
if ([NSToolbar instancesRespondToSelector:@selector(setSelectedItemIdentifier:)])
[[window toolbar] setSelectedItemIdentifier:currentPaneIdentifier];
} }
else { else {
NSRunCriticalAlertPanel( NSLocalizedString( @"Preferences Error", nil ), NSRunCriticalAlertPanel( NSLocalizedString( @"Preferences Error", nil ),
@ -318,6 +321,18 @@ NSString *MVPreferencesWindowNotification = @"MVPreferencesWindowNotification";
return items; 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 @end
@implementation MVPreferencesController (MVPreferencesControllerPrivate) @implementation MVPreferencesController (MVPreferencesControllerPrivate)