From 817a28291bf508ebc577bc4740c6034c7126c81a Mon Sep 17 00:00:00 2001 From: Akos Kitta Date: Tue, 22 Oct 2019 15:54:33 +0200 Subject: [PATCH] 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 --- .../src/browser/arduino-frontend-contribution.tsx | 13 +++++++++++++ 1 file changed, 13 insertions(+) diff --git a/arduino-ide-extension/src/browser/arduino-frontend-contribution.tsx b/arduino-ide-extension/src/browser/arduino-frontend-contribution.tsx index c3e4fb75..416e5d9c 100644 --- a/arduino-ide-extension/src/browser/arduino-frontend-contribution.tsx +++ b/arduino-ide-extension/src/browser/arduino-frontend-contribution.tsx @@ -349,6 +349,19 @@ export class ArduinoFrontendContribution implements TabBarToolbarContribution, C registerMenus(registry: MenuModelRegistry) { 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(FileDownloadCommands.DOWNLOAD);