提交 3258a286 编写于 作者: S SteVen Batten

clarify activity bar action menu layout

refs #40262
上级 fd9ace84
......@@ -246,15 +246,15 @@ export class AccountsActionViewItem extends ActivityActionViewItem {
const accountsActions: IAction[] = [];
const accountsMenu = this.menuService.createMenu(MenuId.AccountsContext, this.contextKeyService);
const actionsDisposable = createAndFillInActionBarActions(accountsMenu, undefined, { primary: [], secondary: accountsActions });
const native = getTitleBarStyle(this.configurationService, this.environmentService) === 'native';
const customOrMac = getTitleBarStyle(this.configurationService, this.environmentService) !== 'native' || isMacintosh; // using the location logic on mac helps with #40262
const position = this.configurationService.getValue('workbench.sideBar.location');
const containerPosition = DOM.getDomNodePagePosition(this.container);
const location = { x: containerPosition.left + (position === 'left' ? containerPosition.width : 0), y: containerPosition.top };
const actions = await this.getActions(accountsMenu);
this.contextMenuService.showContextMenu({
getAnchor: () => !native ? location : e || this.container,
anchorAlignment: !native ? (position === 'left' ? AnchorAlignment.RIGHT : AnchorAlignment.LEFT) : undefined,
getAnchor: () => customOrMac ? location : e || this.container,
anchorAlignment: customOrMac ? (position === 'left' ? AnchorAlignment.RIGHT : AnchorAlignment.LEFT) : undefined,
getActions: () => actions,
onHide: () => {
accountsMenu.dispose();
......@@ -308,14 +308,14 @@ export class GlobalActivityActionViewItem extends ActivityActionViewItem {
const globalActivityActions: IAction[] = [];
const globalActivityMenu = this.menuService.createMenu(MenuId.GlobalActivity, this.contextKeyService);
const actionsDisposable = createAndFillInActionBarActions(globalActivityMenu, undefined, { primary: [], secondary: globalActivityActions });
const native = getTitleBarStyle(this.configurationService, this.environmentService) === 'native';
const customOrMac = getTitleBarStyle(this.configurationService, this.environmentService) !== 'native' || isMacintosh; // using the location logic on mac helps with #40262
const position = this.configurationService.getValue('workbench.sideBar.location');
const containerPosition = DOM.getDomNodePagePosition(this.container);
const location = { x: containerPosition.left + (position === 'left' ? containerPosition.width : 0), y: containerPosition.top + containerPosition.height };
this.contextMenuService.showContextMenu({
getAnchor: () => !native ? location : e || this.container,
anchorAlignment: !native ? (position === 'left' ? AnchorAlignment.RIGHT : AnchorAlignment.LEFT) : undefined,
getAnchor: () => customOrMac ? location : e || this.container,
anchorAlignment: customOrMac ? (position === 'left' ? AnchorAlignment.RIGHT : AnchorAlignment.LEFT) : undefined,
getActions: () => globalActivityActions,
onHide: () => {
globalActivityMenu.dispose();
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册