提交 213eb873 编写于 作者: I isidor

Panel: remove the "toggle location" action in the panel header and move it to menu

fixes #58575
上级 5a0c4ad7
......@@ -682,6 +682,7 @@ export class CodeMenu {
}
const moveSidebar = this.createMenuItem(moveSideBarLabel, 'workbench.action.toggleSidebarPosition');
const movePanel = this.createMenuItem(nls.localize('togglePanelPosition', "Toggle Panel Position"), 'workbench.action.togglePanelPosition');
const togglePanel = this.createMenuItem(nls.localize({ key: 'miTogglePanel', comment: ['&& denotes a mnemonic'] }, "Toggle &&Panel"), 'workbench.action.togglePanel');
let statusBarLabel: string;
......@@ -712,6 +713,7 @@ export class CodeMenu {
__separator__(),
moveSidebar,
toggleSidebar,
movePanel,
togglePanel,
toggleStatusbar,
toggleActivtyBar,
......@@ -1291,4 +1293,4 @@ export class CodeMenu {
function __separator__(): Electron.MenuItem {
return new MenuItem({ type: 'separator' });
}
\ No newline at end of file
}
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.icon-canvas-transparent,.icon-vs-out{fill:#2d2d30;}.icon-canvas-transparent{opacity:0;}.icon-vs-fg{fill:#2b282e;}.icon-vs-bg{fill:#c5c5c5;}</style></defs><title>DockBottom_16x</title><path class="icon-canvas-transparent" d="M16,0V16H0V0Z"/><path class="icon-vs-out" d="M16,1V15H0V1Z" style="display: none;"/><path class="icon-vs-fg" d="M14,3V9H2V3Z" style="display: none;"/><path class="icon-vs-bg" d="M1,2V14H15V2ZM14,9H2V3H14Z"/></svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.icon-canvas-transparent,.icon-vs-out{fill:#f6f6f6;}.icon-canvas-transparent{opacity:0;}.icon-vs-fg{fill:#f0eff1;}.icon-vs-bg{fill:#424242;}</style></defs><title>DockBottom_16x</title><path class="icon-canvas-transparent" d="M16,0V16H0V0Z"/><path class="icon-vs-out" d="M16,1V15H0V1Z" style="display: none;"/><path class="icon-vs-fg" d="M14,3V9H2V3Z" style="display: none;"/><path class="icon-vs-bg" d="M1,2V14H15V2ZM14,9H2V3H14Z"/></svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.icon-canvas-transparent,.icon-vs-out{fill:#2d2d30;}.icon-canvas-transparent{opacity:0;}.icon-vs-fg{fill:#2b282e;}.icon-vs-bg{fill:#c5c5c5;}</style></defs><title>DockRight_16x</title><path class="icon-canvas-transparent" d="M16,0V16H0V0Z"/><path class="icon-vs-out" d="M16,1V15H0V1Z" style="display: none;"/><path class="icon-vs-fg" d="M10,3V13H2V3Z" style="display: none;"/><path class="icon-vs-bg" d="M1,2V14H15V2Zm9,11H2V3h8Z"/></svg>
\ No newline at end of file
<svg xmlns="http://www.w3.org/2000/svg" viewBox="0 0 16 16"><defs><style>.icon-canvas-transparent,.icon-vs-out{fill:#f6f6f6;}.icon-canvas-transparent{opacity:0;}.icon-vs-fg{fill:#f0eff1;}.icon-vs-bg{fill:#424242;}</style></defs><title>DockRight_16x</title><path class="icon-canvas-transparent" d="M16,0V16H0V0Z"/><path class="icon-vs-out" d="M16,1V15H0V1Z" style="display: none;"/><path class="icon-vs-fg" d="M10,3V13H2V3Z" style="display: none;"/><path class="icon-vs-bg" d="M1,2V14H15V2Zm9,11H2V3h8Z"/></svg>
\ No newline at end of file
......@@ -147,24 +147,6 @@
background-image: url('right-inverse.svg');
}
.monaco-workbench .move-panel-to-right {
background: url('panel-right.svg') center center no-repeat;
}
.vs-dark .monaco-workbench .move-panel-to-right,
.hc-black .monaco-workbench .move-panel-to-right {
background: url('panel-right-inverse.svg') center center no-repeat;
}
.monaco-workbench .move-panel-to-bottom {
background: url('panel-bottom.svg') center center no-repeat;
}
.vs-dark .monaco-workbench .move-panel-to-bottom,
.hc-black .monaco-workbench .move-panel-to-bottom {
background: url('panel-bottom-inverse.svg') center center no-repeat;
}
.vs-dark .monaco-workbench .hide-panel-action,
.hc-black .monaco-workbench .hide-panel-action {
background: url('close-inverse.svg') center center no-repeat;
......
......@@ -88,8 +88,8 @@ export class TogglePanelPositionAction extends Action {
static readonly ID = 'workbench.action.togglePanelPosition';
static readonly LABEL = nls.localize('toggledPanelPosition', "Toggle Panel Position");
private static readonly MOVE_TO_RIGHT_LABEL = nls.localize('moveToRight', "Move to Right");
private static readonly MOVE_TO_BOTTOM_LABEL = nls.localize('moveToBottom', "Move to Bottom");
private static readonly MOVE_TO_RIGHT_LABEL = nls.localize('moveToRight', "Move Panel to Right");
private static readonly MOVE_TO_BOTTOM_LABEL = nls.localize('moveToBottom', "Move Panel to Bottom");
private toDispose: IDisposable[];
......@@ -97,7 +97,6 @@ export class TogglePanelPositionAction extends Action {
id: string,
label: string,
@IPartService private partService: IPartService,
) {
super(id, label, partService.getPanelPosition() === Position.RIGHT ? 'move-panel-to-bottom' : 'move-panel-to-right');
this.toDispose = [];
......@@ -186,3 +185,12 @@ MenuRegistry.appendMenuItem(MenuId.MenubarAppearanceMenu, {
},
order: 5
});
MenuRegistry.appendMenuItem(MenuId.MenubarAppearanceMenu, {
group: '2_workbench_layout',
command: {
id: TogglePanelPositionAction.ID,
title: TogglePanelPositionAction.LABEL
},
order: 3
});
......@@ -89,7 +89,10 @@ export class PanelPart extends CompositePart<Panel> implements IPanelService {
getActivityAction: (compositeId: string) => this.getCompositeActions(compositeId).activityAction,
getCompositePinnedAction: (compositeId: string) => this.getCompositeActions(compositeId).pinnedAction,
getOnCompositeClickAction: (compositeId: string) => this.instantiationService.createInstance(PanelActivityAction, this.getPanel(compositeId)),
getContextMenuActions: () => [this.instantiationService.createInstance(TogglePanelAction, TogglePanelAction.ID, localize('hidePanel', "Hide Panel"))],
getContextMenuActions: () => [
this.instantiationService.createInstance(TogglePanelPositionAction, TogglePanelPositionAction.ID, TogglePanelPositionAction.LABEL),
this.instantiationService.createInstance(TogglePanelAction, TogglePanelAction.ID, localize('hidePanel', "Hide Panel"))
],
getDefaultCompositeId: () => Registry.as<PanelRegistry>(PanelExtensions.Panels).getDefaultPanelId(),
hidePart: () => this.partService.setPanelHidden(true),
compositeSize: 0,
......@@ -210,7 +213,6 @@ export class PanelPart extends CompositePart<Panel> implements IPanelService {
protected getActions(): IAction[] {
return [
this.instantiationService.createInstance(ToggleMaximizedPanelAction, ToggleMaximizedPanelAction.ID, ToggleMaximizedPanelAction.LABEL),
this.instantiationService.createInstance(TogglePanelPositionAction, TogglePanelPositionAction.ID, TogglePanelPositionAction.LABEL),
this.instantiationService.createInstance(ClosePanelAction, ClosePanelAction.ID, ClosePanelAction.LABEL)
];
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册