Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

macos - restore ability to reveal any path segment in os from titlebar context menu #199503

Merged
merged 1 commit into from
Nov 29, 2023
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
1 change: 0 additions & 1 deletion src/vs/platform/actions/common/actions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -126,7 +126,6 @@ export class MenuId {
static readonly TestPeekTitle = new MenuId('TestPeekTitle');
static readonly TouchBarContext = new MenuId('TouchBarContext');
static readonly TitleBarContext = new MenuId('TitleBarContext');
static readonly TitleBarTitleContext = new MenuId('TitleBarTitleContext');
static readonly TunnelContext = new MenuId('TunnelContext');
static readonly TunnelPrivacy = new MenuId('TunnelPrivacy');
static readonly TunnelProtocol = new MenuId('TunnelProtocol');
Expand Down
1 change: 1 addition & 0 deletions src/vs/workbench/browser/actions/layoutActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -765,6 +765,7 @@ if (isWindows || isLinux || isWeb) {
title: localize('miMenuBarNoMnemonic', "Menu Bar"),
toggled: ContextKeyExpr.and(IsMacNativeContext.toNegated(), ContextKeyExpr.notEquals('config.window.menuBarVisibility', 'hidden'), ContextKeyExpr.notEquals('config.window.menuBarVisibility', 'toggle'), ContextKeyExpr.notEquals('config.window.menuBarVisibility', 'compact'))
},
group: '2_config',
when: IsAuxiliaryWindowFocusedContext.toNegated(),
order: 0
});
Expand Down
5 changes: 3 additions & 2 deletions src/vs/workbench/browser/parts/titlebar/titlebarActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -24,7 +24,8 @@ class ToggleConfigAction extends Action2 {
menu: {
id: MenuId.TitleBarContext,
when: mainWindowOnly ? IsAuxiliaryWindowFocusedContext.toNegated() : undefined,
order
order,
group: '2_config'
}
});
}
Expand Down Expand Up @@ -55,7 +56,7 @@ registerAction2(class ToggleEditorActions extends Action2 {
id: `toggle.${ToggleEditorActions.settingsID}`,
title: localize('toggle.editorActions', 'Editor Actions'),
toggled: ContextKeyExpr.equals(`config.${ToggleEditorActions.settingsID}`, 'hidden').negate(),
menu: { id: MenuId.TitleBarContext, order: 3, when: ContextKeyExpr.equals(`config.workbench.editor.showTabs`, 'none') }
menu: { id: MenuId.TitleBarContext, order: 3, when: ContextKeyExpr.equals(`config.workbench.editor.showTabs`, 'none'), group: '2_config' }
});
}

Expand Down
2 changes: 1 addition & 1 deletion src/vs/workbench/browser/parts/titlebar/titlebarPart.ts
Original file line number Diff line number Diff line change
Expand Up @@ -418,7 +418,7 @@ export class BrowserTitlebarPart extends Part implements ITitlebarPart {
if (e.type === EventType.CONTEXT_MENU || (e.target === this.title && e.metaKey)) {
EventHelper.stop(e);

this.onContextMenu(e, e.target === this.title ? MenuId.TitleBarTitleContext : MenuId.TitleBarContext);
this.onContextMenu(e, MenuId.TitleBarContext);
}
}));
});
Expand Down
6 changes: 5 additions & 1 deletion src/vs/workbench/electron-sandbox/window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -660,7 +660,11 @@ export class NativeWindow extends BaseWindow {

const commandId = `workbench.action.revealPathInFinder${i}`;
this.customTitleContextMenuDisposable.add(CommandsRegistry.registerCommand(commandId, () => this.nativeHostService.showItemInFolder(path.fsPath)));
this.customTitleContextMenuDisposable.add(MenuRegistry.appendMenuItem(MenuId.TitleBarTitleContext, { command: { id: commandId, title: label || posix.sep }, order: -i }));
this.customTitleContextMenuDisposable.add(MenuRegistry.appendMenuItem(MenuId.TitleBarContext, {
command: { id: commandId, title: label || posix.sep },
order: -i,
group: '1_file'
}));
}
}

Expand Down