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

Adds support for separate horizontal and vertical borders for side by side editor #135181

Merged
merged 2 commits into from Oct 23, 2021
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
6 changes: 3 additions & 3 deletions src/vs/workbench/browser/parts/editor/sideBySideEditor.ts
Expand Up @@ -25,7 +25,7 @@ import { IEditorOptions } from 'vs/platform/editor/common/editor';
import { IConfigurationChangeEvent, IConfigurationService } from 'vs/platform/configuration/common/configuration';
import { DEFAULT_EDITOR_MIN_DIMENSIONS } from 'vs/workbench/browser/parts/editor/editor';
import { DisposableStore } from 'vs/base/common/lifecycle';
import { SIDE_BY_SIDE_EDITOR_BORDER } from 'vs/workbench/common/theme';
import { SIDE_BY_SIDE_EDITOR_HORIZONTAL_BORDER, SIDE_BY_SIDE_EDITOR_VERTICAL_BORDER } from 'vs/workbench/common/theme';
import { AbstractEditorWithViewState } from 'vs/workbench/browser/parts/editor/editorWithViewState';
import { ITextResourceConfigurationService } from 'vs/editor/common/services/textResourceConfigurationService';
import { IEditorService } from 'vs/workbench/services/editor/common/editorService';
Expand Down Expand Up @@ -433,13 +433,13 @@ export class SideBySideEditor extends AbstractEditorWithViewState<ISideBySideEdi
if (this.orientation === Orientation.HORIZONTAL) {
this.primaryEditorContainer.style.borderLeftWidth = '1px';
this.primaryEditorContainer.style.borderLeftStyle = 'solid';
this.primaryEditorContainer.style.borderLeftColor = this.getColor(SIDE_BY_SIDE_EDITOR_BORDER)?.toString() ?? '';
this.primaryEditorContainer.style.borderLeftColor = this.getColor(SIDE_BY_SIDE_EDITOR_VERTICAL_BORDER)?.toString() ?? '';

this.primaryEditorContainer.style.borderTopWidth = '0';
} else {
this.primaryEditorContainer.style.borderTopWidth = '1px';
this.primaryEditorContainer.style.borderTopStyle = 'solid';
this.primaryEditorContainer.style.borderTopColor = this.getColor(SIDE_BY_SIDE_EDITOR_BORDER)?.toString() ?? '';
this.primaryEditorContainer.style.borderTopColor = this.getColor(SIDE_BY_SIDE_EDITOR_HORIZONTAL_BORDER)?.toString() ?? '';

this.primaryEditorContainer.style.borderLeftWidth = '0';
}
Expand Down
10 changes: 8 additions & 2 deletions src/vs/workbench/common/theme.ts
Expand Up @@ -243,11 +243,17 @@ export const EDITOR_DRAG_AND_DROP_BACKGROUND = registerColor('editorGroup.dropBa
hc: null
}, localize('editorDragAndDropBackground', "Background color when dragging editors around. The color should have transparency so that the editor contents can still shine through."));

export const SIDE_BY_SIDE_EDITOR_BORDER = registerColor('sideBySideEditor.border', {
export const SIDE_BY_SIDE_EDITOR_HORIZONTAL_BORDER = registerColor('sideBySideEditor.horizontalBorder', {
dark: EDITOR_GROUP_BORDER,
light: EDITOR_GROUP_BORDER,
hc: EDITOR_GROUP_BORDER
}, localize('sideBySideEditor.border', "Color to separate two editors from each other when shown side by side in an editor group."));
}, localize('sideBySideEditor.horizontalBorder', "Color to separate two editors from each other when shown side by side in an editor group from top to bottom."));

export const SIDE_BY_SIDE_EDITOR_VERTICAL_BORDER = registerColor('sideBySideEditor.verticalBorder', {
dark: EDITOR_GROUP_BORDER,
light: EDITOR_GROUP_BORDER,
hc: EDITOR_GROUP_BORDER
}, localize('sideBySideEditor.verticalBorder', "Color to separate two editors from each other when shown side by side in an editor group from left to right."));

// < --- Panels --- >

Expand Down