提交 a04802f5 编写于 作者: S Sandeep Somavarapu

#113757 show panel move and hide actions on view context menu

上级 f2950256
...@@ -283,7 +283,10 @@ registerAction2(class extends Action2 { ...@@ -283,7 +283,10 @@ registerAction2(class extends Action2 {
} }
}); });
MenuRegistry.appendMenuItem(MenuId.MenubarAppearanceMenu, { MenuRegistry.appendMenuItems([
{
id: MenuId.MenubarAppearanceMenu,
item: {
group: '2_workbench_layout', group: '2_workbench_layout',
command: { command: {
id: TogglePanelAction.ID, id: TogglePanelAction.ID,
...@@ -291,14 +294,29 @@ MenuRegistry.appendMenuItem(MenuId.MenubarAppearanceMenu, { ...@@ -291,14 +294,29 @@ MenuRegistry.appendMenuItem(MenuId.MenubarAppearanceMenu, {
toggled: ActivePanelContext toggled: ActivePanelContext
}, },
order: 5 order: 5
}); }
}, {
id: MenuId.ViewTitleContext,
item: {
group: '3_workbench_layout_move',
command: {
id: TogglePanelAction.ID,
title: { value: nls.localize('hidePanel', "Hide Panel"), original: 'Hide Panel' },
},
when: PanelVisibleContext,
order: 2
}
}
]);
function registerPositionPanelActionById(config: PanelActionConfig<Position>) { function registerPositionPanelActionById(config: PanelActionConfig<Position>) {
const { id, label, alias, when } = config; const { id, label, alias, when } = config;
// register the workbench action // register the workbench action
actionRegistry.registerWorkbenchAction(SyncActionDescriptor.create(SetPanelPositionAction, id, label), alias, CATEGORIES.View.value, when); actionRegistry.registerWorkbenchAction(SyncActionDescriptor.create(SetPanelPositionAction, id, label), alias, CATEGORIES.View.value, when);
// register as a menu item // register as a menu item
MenuRegistry.appendMenuItem(MenuId.MenubarAppearanceMenu, { MenuRegistry.appendMenuItems([{
id: MenuId.MenubarAppearanceMenu,
item: {
group: '3_workbench_layout_move', group: '3_workbench_layout_move',
command: { command: {
id, id,
...@@ -306,7 +324,19 @@ function registerPositionPanelActionById(config: PanelActionConfig<Position>) { ...@@ -306,7 +324,19 @@ function registerPositionPanelActionById(config: PanelActionConfig<Position>) {
}, },
when, when,
order: 5 order: 5
}); }
}, {
id: MenuId.ViewTitleContext,
item: {
group: '3_workbench_layout_move',
command: {
id: id,
title: label,
},
when,
order: 1
}
}]);
} }
// register each position panel action // register each position panel action
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册