mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-30 04:06:26 +01:00
remove get*Actions from view pane
This commit is contained in:
@@ -192,7 +192,8 @@ export abstract class ViewPane extends Pane implements IView {
|
||||
return this._titleDescription;
|
||||
}
|
||||
|
||||
private readonly menuActions: ViewMenuActions;
|
||||
readonly menuActions: ViewMenuActions;
|
||||
|
||||
private progressBar!: ProgressBar;
|
||||
private progressIndicator!: IProgressIndicator;
|
||||
|
||||
@@ -478,7 +479,7 @@ export abstract class ViewPane extends Pane implements IView {
|
||||
|
||||
private setActions(): void {
|
||||
if (this.toolbar) {
|
||||
this.toolbar.setActions(prepareActions(this.getActions()), prepareActions(this.getSecondaryActions()));
|
||||
this.toolbar.setActions(prepareActions(this.menuActions.getPrimaryActions()), prepareActions(this.menuActions.getSecondaryActions()));
|
||||
this.toolbar.context = this.getActionsContext();
|
||||
}
|
||||
}
|
||||
@@ -496,18 +497,6 @@ export abstract class ViewPane extends Pane implements IView {
|
||||
this._onDidChangeTitleArea.fire();
|
||||
}
|
||||
|
||||
getActions(): IAction[] {
|
||||
return this.menuActions.getPrimaryActions();
|
||||
}
|
||||
|
||||
getSecondaryActions(): IAction[] {
|
||||
return this.menuActions.getSecondaryActions();
|
||||
}
|
||||
|
||||
getContextMenuActions(): IAction[] {
|
||||
return this.menuActions.getContextMenuActions();
|
||||
}
|
||||
|
||||
getActionViewItem(action: IAction): IActionViewItem | undefined {
|
||||
return createActionViewItem(this.instantiationService, action);
|
||||
}
|
||||
|
||||
@@ -583,13 +583,13 @@ export class ViewPaneContainer extends Component implements IViewPaneContainer {
|
||||
const result = [];
|
||||
result.push(...this.menuActions.getPrimaryActions());
|
||||
if (this.isViewMergedWithContainer()) {
|
||||
result.push(...this.paneItems[0].pane.getActions());
|
||||
result.push(...this.paneItems[0].pane.menuActions.getPrimaryActions());
|
||||
}
|
||||
return result;
|
||||
}
|
||||
|
||||
getSecondaryActions(): IAction[] {
|
||||
const viewPaneActions = this.isViewMergedWithContainer() ? this.paneItems[0].pane.getSecondaryActions() : [];
|
||||
const viewPaneActions = this.isViewMergedWithContainer() ? this.paneItems[0].pane.menuActions.getSecondaryActions() : [];
|
||||
let menuActions = this.menuActions.getSecondaryActions();
|
||||
|
||||
const viewsSubmenuActionIndex = menuActions.findIndex(action => action instanceof SubmenuItemAction && action.item.submenu === ViewsSubMenu);
|
||||
@@ -768,7 +768,7 @@ export class ViewPaneContainer extends Component implements IViewPaneContainer {
|
||||
event.stopPropagation();
|
||||
event.preventDefault();
|
||||
|
||||
const actions: IAction[] = viewPane.getContextMenuActions();
|
||||
const actions: IAction[] = viewPane.menuActions.getContextMenuActions();
|
||||
|
||||
let anchor: { x: number, y: number } = { x: event.posx, y: event.posy };
|
||||
this.contextMenuService.showContextMenu({
|
||||
|
||||
Reference in New Issue
Block a user