fixed duplicate preferences menu item.

Signed-off-by: Akos Kitta <kittaakos@typefox.io>
This commit is contained in:
Akos Kitta 2020-08-14 11:24:59 +02:00
parent e72e794266
commit f605994d7d
2 changed files with 4 additions and 7 deletions

View File

@ -19,8 +19,7 @@ export class CommonFrontendContribution extends TheiaCommonFrontendContribution
CommonCommands.AUTO_SAVE, CommonCommands.AUTO_SAVE,
CommonCommands.OPEN_PREFERENCES, CommonCommands.OPEN_PREFERENCES,
CommonCommands.SELECT_ICON_THEME, CommonCommands.SELECT_ICON_THEME,
CommonCommands.SELECT_COLOR_THEME, CommonCommands.SELECT_COLOR_THEME
CommonCommands.OPEN_PREFERENCES
]) { ]) {
registry.unregisterMenuAction(command); registry.unregisterMenuAction(command);
} }

View File

@ -1,5 +1,4 @@
import { injectable } from 'inversify'; import { injectable } from 'inversify';
import { isOSX } from '@theia/core/lib/common/os';
import { MenuModelRegistry } from '@theia/core/lib/common/menu'; import { MenuModelRegistry } from '@theia/core/lib/common/menu';
import { KeybindingRegistry } from '@theia/core/lib/browser/keybinding'; import { KeybindingRegistry } from '@theia/core/lib/browser/keybinding';
import { CommonCommands, CommonMenus } from '@theia/core/lib/browser'; import { CommonCommands, CommonMenus } from '@theia/core/lib/browser';
@ -10,10 +9,9 @@ export class PreferencesContribution extends TheiaPreferencesContribution {
registerMenus(registry: MenuModelRegistry): void { registerMenus(registry: MenuModelRegistry): void {
super.registerMenus(registry); super.registerMenus(registry);
if (isOSX) { // The settings group: preferences, CLI config is not part of the `File` menu on macOS.
// The settings group: preferences, CLI config is not part of the `File` menu on macOS. // On Windows and Linux, we rebind it to `Preferences...`. It is safe to remove here.
registry.unregisterMenuAction(CommonCommands.OPEN_PREFERENCES.id, CommonMenus.FILE_SETTINGS_SUBMENU_OPEN); registry.unregisterMenuAction(CommonCommands.OPEN_PREFERENCES.id, CommonMenus.FILE_SETTINGS_SUBMENU_OPEN);
}
} }
registerKeybindings(registry: KeybindingRegistry): void { registerKeybindings(registry: KeybindingRegistry): void {