mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-11-16 05:39:28 +00:00
redesigned the settings menu group.
Signed-off-by: Akos Kitta <kittaakos@typefox.io>
This commit is contained in:
@@ -1,6 +1,8 @@
|
||||
import { injectable } from 'inversify'
|
||||
import { remote } from 'electron';
|
||||
import { Keybinding } from '@theia/core/lib/common/keybinding';
|
||||
import { ElectronMainMenuFactory as TheiaElectronMainMenuFactory } from '@theia/core/lib/electron-browser/menu/electron-main-menu-factory';
|
||||
import { ArduinoMenus } from '../../../browser/menu/arduino-menus';
|
||||
|
||||
@injectable()
|
||||
export class ElectronMainMenuFactory extends TheiaElectronMainMenuFactory {
|
||||
@@ -14,4 +16,25 @@ export class ElectronMainMenuFactory extends TheiaElectronMainMenuFactory {
|
||||
.replace('→', 'Right');
|
||||
}
|
||||
|
||||
protected createOSXMenu(): Electron.MenuItemConstructorOptions {
|
||||
const { submenu } = super.createOSXMenu();
|
||||
const label = 'Arduino Pro IDE';
|
||||
if (!!submenu && !(submenu instanceof remote.Menu)) {
|
||||
const [about, , ...rest] = submenu;
|
||||
const menuModel = this.menuProvider.getMenu(ArduinoMenus.FILE__SETTINGS_GROUP);
|
||||
const settings = this.fillMenuTemplate([], menuModel);
|
||||
return {
|
||||
label,
|
||||
submenu: [
|
||||
about, // TODO: we have two about dialogs! one from electron the other from Theia.
|
||||
{ type: 'separator' },
|
||||
...settings,
|
||||
{ type: 'separator' },
|
||||
...rest
|
||||
]
|
||||
};
|
||||
}
|
||||
return { label, submenu };
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user