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

increase titlebar height for macos big sur #110592

Merged
merged 1 commit into from Nov 13, 2020
Merged
Show file tree
Hide file tree
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
4 changes: 2 additions & 2 deletions src/vs/workbench/browser/parts/titlebar/titlebarPart.ts
Expand Up @@ -53,8 +53,8 @@ export class TitlebarPart extends Part implements ITitleService {

readonly minimumWidth: number = 0;
readonly maximumWidth: number = Number.POSITIVE_INFINITY;
get minimumHeight(): number { return isMacintosh && !isWeb ? 22 / getZoomFactor() : (30 / (this.currentMenubarVisibility === 'hidden' ? getZoomFactor() : 1)); }
get maximumHeight(): number { return isMacintosh && !isWeb ? 22 / getZoomFactor() : (30 / (this.currentMenubarVisibility === 'hidden' ? getZoomFactor() : 1)); }
get minimumHeight(): number { return 30 / (this.currentMenubarVisibility === 'hidden' ? getZoomFactor() : 1); }
get maximumHeight(): number { return this.minimumHeight; }

//#endregion

Expand Down
16 changes: 14 additions & 2 deletions src/vs/workbench/electron-sandbox/parts/titlebar/titlebarPart.ts
Expand Up @@ -9,7 +9,7 @@ import { IContextKeyService } from 'vs/platform/contextkey/common/contextkey';
import { IConfigurationService, IConfigurationChangeEvent } from 'vs/platform/configuration/common/configuration';
import { ILabelService } from 'vs/platform/label/common/label';
import { IStorageService } from 'vs/platform/storage/common/storage';
import { IWorkbenchEnvironmentService } from 'vs/workbench/services/environment/common/environmentService';
import { INativeWorkbenchEnvironmentService } from 'vs/workbench/services/environment/electron-sandbox/environmentService';
import { IHostService } from 'vs/workbench/services/host/browser/host';
import { isMacintosh, isWindows, isLinux } from 'vs/base/common/platform';
import { IMenuService } from 'vs/platform/actions/common/actions';
Expand All @@ -32,11 +32,23 @@ export class TitlebarPart extends BrowserTitleBarPart {
private dragRegion: HTMLElement | undefined;
private resizer: HTMLElement | undefined;

private getMacTitlebarSize() {
const osVersion = this.environmentService.os.release;
if (parseFloat(osVersion) >= 20) { // Big Sur increases title bar height
return 28;
}

return 22;
}

get minimumHeight(): number { return isMacintosh ? this.getMacTitlebarSize() : super.minimumHeight; }
get maximumHeight(): number { return this.minimumHeight; }

constructor(
@IContextMenuService contextMenuService: IContextMenuService,
@IConfigurationService protected readonly configurationService: IConfigurationService,
@IEditorService editorService: IEditorService,
@IWorkbenchEnvironmentService protected readonly environmentService: IWorkbenchEnvironmentService,
@INativeWorkbenchEnvironmentService protected readonly environmentService: INativeWorkbenchEnvironmentService,
@IWorkspaceContextService contextService: IWorkspaceContextService,
@IInstantiationService instantiationService: IInstantiationService,
@IThemeService themeService: IThemeService,
Expand Down