-
-
Notifications
You must be signed in to change notification settings - Fork 436
/
Copy pathelectron-menu-contribution.ts
35 lines (28 loc) · 1.27 KB
/
electron-menu-contribution.ts
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
import { injectable } from 'inversify';
import { CommandRegistry } from '@theia/core/lib/common/command';
import { MenuModelRegistry } from '@theia/core/lib/common/menu';
import { KeybindingRegistry } from '@theia/core/lib/browser/keybinding';
import { ElectronMenuContribution as TheiaElectronMenuContribution, ElectronCommands } from '@theia/core/lib/electron-browser/menu/electron-menu-contribution';
import { MainMenuManager } from '../../../common/main-menu-manager';
@injectable()
export class ElectronMenuContribution extends TheiaElectronMenuContribution implements MainMenuManager {
protected hideTopPanel(): void {
// NOOP
// We reuse the `div` for the Arduino toolbar.
}
update(): void {
(this as any).setMenu();
}
registerCommands(registry: CommandRegistry): void {
super.registerCommands(registry);
registry.unregisterCommand(ElectronCommands.CLOSE_WINDOW);
}
registerMenus(registry: MenuModelRegistry): void {
super.registerMenus(registry);
registry.unregisterMenuAction(ElectronCommands.CLOSE_WINDOW);
}
registerKeybindings(registry: KeybindingRegistry): void {
super.registerKeybindings(registry);
registry.unregisterKeybinding(ElectronCommands.CLOSE_WINDOW.id);
}
}