Skip to content

Commit

Permalink
Candidate/142146 (#142424)
Browse files Browse the repository at this point in the history
* refs #142146

* refs #142146
  • Loading branch information
sbatten authored Feb 9, 2022
1 parent 22fb1cf commit a4e0d1f
Show file tree
Hide file tree
Showing 2 changed files with 30 additions and 0 deletions.
3 changes: 3 additions & 0 deletions src/vs/workbench/browser/actions/layoutActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -903,13 +903,16 @@ abstract class BaseResizeViewAction extends Action2 {
const isEditorFocus = layoutService.hasFocus(Parts.EDITOR_PART);
const isSidebarFocus = layoutService.hasFocus(Parts.SIDEBAR_PART);
const isPanelFocus = layoutService.hasFocus(Parts.PANEL_PART);
const isAuxiliaryBarFocus = layoutService.hasFocus(Parts.AUXILIARYBAR_PART);

if (isSidebarFocus) {
part = Parts.SIDEBAR_PART;
} else if (isPanelFocus) {
part = Parts.PANEL_PART;
} else if (isEditorFocus) {
part = Parts.EDITOR_PART;
} else if (isAuxiliaryBarFocus) {
part = Parts.AUXILIARYBAR_PART;
}
} else {
part = partToResize;
Expand Down
27 changes: 27 additions & 0 deletions src/vs/workbench/browser/actions/navigationActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,7 @@ abstract class BaseNavigationAction extends Action {
const isEditorFocus = this.layoutService.hasFocus(Parts.EDITOR_PART);
const isPanelFocus = this.layoutService.hasFocus(Parts.PANEL_PART);
const isSidebarFocus = this.layoutService.hasFocus(Parts.SIDEBAR_PART);
const isAuxiliaryBarFocus = this.layoutService.hasFocus(Parts.AUXILIARYBAR_PART);

let neighborPart: Parts | undefined;
if (isEditorFocus) {
Expand All @@ -54,6 +55,10 @@ abstract class BaseNavigationAction extends Action {
neighborPart = this.layoutService.getVisibleNeighborPart(Parts.SIDEBAR_PART, this.direction);
}

if (isAuxiliaryBarFocus) {
neighborPart = neighborPart = this.layoutService.getVisibleNeighborPart(Parts.AUXILIARYBAR_PART, this.direction);
}

if (neighborPart === Parts.EDITOR_PART) {
if (!this.navigateBackToEditorGroup(this.toGroupDirection(this.direction))) {
this.navigateToEditorGroup(this.direction === Direction.Right ? GroupLocation.FIRST : GroupLocation.LAST);
Expand All @@ -62,6 +67,8 @@ abstract class BaseNavigationAction extends Action {
this.navigateToSidebar();
} else if (neighborPart === Parts.PANEL_PART) {
this.navigateToPanel();
} else if (neighborPart === Parts.AUXILIARYBAR_PART) {
this.navigateToAuxiliaryBar();
}
}

Expand Down Expand Up @@ -100,6 +107,26 @@ abstract class BaseNavigationAction extends Action {
return !!viewlet;
}

private async navigateToAuxiliaryBar(): Promise<IComposite | boolean> {
if (!this.layoutService.isVisible(Parts.AUXILIARYBAR_PART)) {
return false;
}

const activePanel = this.paneCompositeService.getActivePaneComposite(ViewContainerLocation.AuxiliaryBar);
if (!activePanel) {
return false;
}

const activePanelId = activePanel.getId();

const res = await this.paneCompositeService.openPaneComposite(activePanelId, ViewContainerLocation.AuxiliaryBar, true);
if (!res) {
return false;
}

return res;
}

private navigateAcrossEditorGroup(direction: GroupDirection): boolean {
return this.doNavigateToEditorGroup({ direction });
}
Expand Down

0 comments on commit a4e0d1f

Please sign in to comment.