Skip to content

Commit de1f341

Browse files
authored
Merge pull request #74 from bcmi-labs/remove-tab-context-menu-no-pro-mode
Removed the tab context menu when not in pro-mode.
2 parents 06ef598 + 817a282 commit de1f341

File tree

1 file changed

+13
-0
lines changed

1 file changed

+13
-0
lines changed

arduino-ide-extension/src/browser/arduino-frontend-contribution.tsx

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -349,6 +349,19 @@ export class ArduinoFrontendContribution implements TabBarToolbarContribution, C
349349

350350
registerMenus(registry: MenuModelRegistry) {
351351
if (!ArduinoAdvancedMode.TOGGLED) {
352+
// If are not in pro-mode, we have to disable the context menu for the tabs.
353+
// Such as `Close`, `Close All`, etc.
354+
for (const command of [
355+
CommonCommands.CLOSE_TAB,
356+
CommonCommands.CLOSE_OTHER_TABS,
357+
CommonCommands.CLOSE_RIGHT_TABS,
358+
CommonCommands.CLOSE_ALL_TABS,
359+
CommonCommands.COLLAPSE_PANEL,
360+
CommonCommands.TOGGLE_MAXIMIZED
361+
]) {
362+
registry.unregisterMenuAction(command);
363+
}
364+
352365
registry.unregisterMenuAction(FileSystemCommands.UPLOAD);
353366
registry.unregisterMenuAction(FileDownloadCommands.DOWNLOAD);
354367

0 commit comments

Comments
 (0)