Removed the tab context menu when not in pro-mode.

When we are not in `pro-mode`, it does not make much sense to show the
context menu. It does not work anyways.

See: https://arduino.slack.com/archives/CJJHJCJSJ/p1569502896082800?thread_ts=1569489282.073200&cid=CJJHJCJSJ

Signed-off-by: Akos Kitta <kittaakos@typefox.io>
This commit is contained in:
Akos Kitta 2019-10-22 15:54:33 +02:00
parent 06ef598806
commit 817a28291b

View File

@ -349,6 +349,19 @@ export class ArduinoFrontendContribution implements TabBarToolbarContribution, C
registerMenus(registry: MenuModelRegistry) { registerMenus(registry: MenuModelRegistry) {
if (!ArduinoAdvancedMode.TOGGLED) { if (!ArduinoAdvancedMode.TOGGLED) {
// If are not in pro-mode, we have to disable the context menu for the tabs.
// Such as `Close`, `Close All`, etc.
for (const command of [
CommonCommands.CLOSE_TAB,
CommonCommands.CLOSE_OTHER_TABS,
CommonCommands.CLOSE_RIGHT_TABS,
CommonCommands.CLOSE_ALL_TABS,
CommonCommands.COLLAPSE_PANEL,
CommonCommands.TOGGLE_MAXIMIZED
]) {
registry.unregisterMenuAction(command);
}
registry.unregisterMenuAction(FileSystemCommands.UPLOAD); registry.unregisterMenuAction(FileSystemCommands.UPLOAD);
registry.unregisterMenuAction(FileDownloadCommands.DOWNLOAD); registry.unregisterMenuAction(FileDownloadCommands.DOWNLOAD);