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

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

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