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];
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)