fix bug 241093 - icon in preferences dialog for current category should appear selected
This commit is contained in:
Родитель
5fb7b98791
Коммит
06346b1376
|
@ -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)
|
||||
|
|
Загрузка…
Ссылка в новой задаче