Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Remove redundant canActivityBarBeHidden() method #203351

Merged
merged 1 commit into from
Jan 24, 2024
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Jump to
Jump to file
Failed to load files.
Diff view
Diff view
14 changes: 0 additions & 14 deletions src/vs/workbench/browser/layout.ts
Original file line number Diff line number Diff line change
Expand Up @@ -702,13 +702,6 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
}
}

// Activity bar cannot be hidden
// This check must be called after state is set
// because canActivityBarBeHidden calls isVisible
if (this.stateModel.getRuntimeValue(LayoutStateKeys.ACTIVITYBAR_HIDDEN) && !this.canActivityBarBeHidden()) {
this.stateModel.setRuntimeValue(LayoutStateKeys.ACTIVITYBAR_HIDDEN, false);
}

// Window border
this.updateWindowsBorder(true);
}
Expand Down Expand Up @@ -1742,18 +1735,11 @@ export abstract class Layout extends Disposable implements IWorkbenchLayoutServi
}

private setActivityBarHidden(hidden: boolean, skipLayout?: boolean): void {
if (hidden && !this.canActivityBarBeHidden()) {
return;
}
this.stateModel.setRuntimeValue(LayoutStateKeys.ACTIVITYBAR_HIDDEN, hidden);
// Propagate to grid
this.workbenchGrid.setViewVisible(this.activityBarPartView, !hidden);
}

private canActivityBarBeHidden(): boolean {
return this.configurationService.getValue(LayoutSettings.ACTIVITY_BAR_LOCATION) === ActivityBarPosition.TOP;
}

private setBannerHidden(hidden: boolean): void {
this.workbenchGrid.setViewVisible(this.bannerPartView, !hidden);
}
Expand Down