Merge pull request #74 from bcmi-labs/remove-tab-context-menu-no-pro-mode

Removed the tab context menu when not in pro-mode.
This commit is contained in:
Akos Kitta 2019-10-23 10:30:30 +02:00 committed by GitHub
commit de1f341d19
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -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);