mirror of
https://github.com/arduino/arduino-ide.git
synced 2025-11-06 08:58:32 +00:00
ATL-938: Added menu group categories.
Signed-off-by: Akos Kitta <kittaakos@typefox.io>
This commit is contained in:
@@ -1,6 +1,6 @@
|
||||
import { isOSX } from '@theia/core/lib/common/os';
|
||||
import { CommonMenus } from '@theia/core/lib/browser/common-frontend-contribution';
|
||||
import { MAIN_MENU_BAR, MenuModelRegistry, MenuNode } from '@theia/core/lib/common/menu';
|
||||
import { MAIN_MENU_BAR, MenuModelRegistry, MenuNode, MenuPath, SubMenuOptions } from '@theia/core/lib/common/menu';
|
||||
|
||||
export namespace ArduinoMenus {
|
||||
|
||||
@@ -99,3 +99,24 @@ export function unregisterSubmenu(menuPath: string[], menuRegistry: MenuModelReg
|
||||
}
|
||||
(parent.children as Array<MenuNode>).splice(index, 1);
|
||||
}
|
||||
|
||||
/**
|
||||
* Special menu node that is not backed by any commands and is always disabled.
|
||||
*/
|
||||
export class PlaceholderMenuNode implements MenuNode {
|
||||
|
||||
constructor(protected readonly menuPath: MenuPath, readonly label: string, protected options: SubMenuOptions = { order: '0' }) { }
|
||||
|
||||
get icon(): string | undefined {
|
||||
return this.options?.iconClass;
|
||||
}
|
||||
|
||||
get sortString(): string {
|
||||
return this.options?.order || this.label;
|
||||
}
|
||||
|
||||
get id(): string {
|
||||
return [...this.menuPath, 'placeholder'].join('-');
|
||||
}
|
||||
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user