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

tabHeight setting name change #193977

Merged
merged 3 commits into from
Sep 25, 2023
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
5 changes: 5 additions & 0 deletions src/vs/platform/window/common/window.ts
Original file line number Diff line number Diff line change
Expand Up @@ -137,6 +137,11 @@ export interface IWindowSettings {
readonly enableMenuBarMnemonics: boolean;
readonly closeWhenEmpty: boolean;
readonly clickThroughInactive: boolean;
readonly density: IDensitySettings;
}

export interface IDensitySettings {
readonly editorTabHeight: 'default' | 'compact';
}

export function getTitleBarStyle(configurationService: IConfigurationService): 'native' | 'custom' {
Expand Down
12 changes: 9 additions & 3 deletions src/vs/workbench/browser/parts/editor/editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,7 @@ import { ISerializableView } from 'vs/base/browser/ui/grid/grid';
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
import { isObject } from 'vs/base/common/types';
import { IEditorOptions } from 'vs/platform/editor/common/editor';
import { IWindowsConfiguration } from 'vs/platform/window/common/window';

export interface IEditorPartCreationOptions {
restorePreviousState: boolean;
Expand All @@ -32,7 +33,7 @@ export const DEFAULT_EDITOR_PART_OPTIONS: IEditorPartOptions = {
tabSizingFixedMaxWidth: 160,
pinnedTabSizing: 'normal',
pinnedTabsOnSeparateRow: false,
tabHeight: 'normal',
tabHeight: 'default',
preventPinnedEditorClose: 'keyboardAndMouse',
titleScrollbarSizing: 'default',
focusRecentEditorAfterClose: true,
Expand All @@ -50,7 +51,7 @@ export const DEFAULT_EDITOR_PART_OPTIONS: IEditorPartOptions = {
};

export function impactsEditorPartOptions(event: IConfigurationChangeEvent): boolean {
return event.affectsConfiguration('workbench.editor') || event.affectsConfiguration('workbench.iconTheme');
return event.affectsConfiguration('workbench.editor') || event.affectsConfiguration('workbench.iconTheme') || event.affectsConfiguration('window.density');
}

export function getEditorPartOptions(configurationService: IConfigurationService, themeService: IThemeService): IEditorPartOptions {
Expand Down Expand Up @@ -79,6 +80,11 @@ export function getEditorPartOptions(configurationService: IConfigurationService
}
}

const windowConfig = configurationService.getValue<IWindowsConfiguration>();
if (windowConfig?.window?.density?.editorTabHeight) {
options.tabHeight = windowConfig.window.density.editorTabHeight;
}

return options;
}

Expand Down Expand Up @@ -204,7 +210,7 @@ export interface IInternalEditorOpenOptions extends IInternalEditorTitleControlO
supportSideBySide?: SideBySideEditor.ANY | SideBySideEditor.BOTH;

/**
* When set to `true`, pass DOM focus into the tab control.
* When set to `true`, pass DOM focus into the tab control.
*/
focusTabControl?: boolean;
}
Expand Down
6 changes: 3 additions & 3 deletions src/vs/workbench/browser/workbench.contribution.ts
Original file line number Diff line number Diff line change
Expand Up @@ -165,10 +165,10 @@ const registry = Registry.as<IConfigurationRegistry>(ConfigurationExtensions.Con
'minimum': 38,
'markdownDescription': localize({ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'workbench.editor.tabSizingFixedMaxWidth' }, "Controls the maximum width of tabs when `#workbench.editor.tabSizing#` size is set to `fixed`.")
},
'workbench.editor.tabHeight': {
'window.density.editorTabHeight': {
'type': 'string',
'enum': ['normal', 'compact'],
'default': 'normal',
'enum': ['default', 'compact'],
'default': 'default',
'markdownDescription': localize({ comment: ['This is the description for a setting. Values surrounded by single quotes are not to be translated.'], key: 'workbench.editor.tabHeight' }, "Controls the height of editor tabs. Also applies to the title control bar when `#workbench.editor.showTabs#` is disabled.")
},
'workbench.editor.pinnedTabSizing': {
Expand Down
2 changes: 1 addition & 1 deletion src/vs/workbench/common/editor.ts
Original file line number Diff line number Diff line change
Expand Up @@ -1100,7 +1100,7 @@ interface IEditorPartConfiguration {
tabSizingFixedMaxWidth?: number;
pinnedTabSizing?: 'normal' | 'compact' | 'shrink';
pinnedTabsOnSeparateRow?: boolean;
tabHeight?: 'normal' | 'compact';
tabHeight?: 'default' | 'compact';
preventPinnedEditorClose?: PreventPinnedEditorClose;
titleScrollbarSizing?: 'default' | 'large';
focusRecentEditorAfterClose?: boolean;
Expand Down