提交 efb3ee7b 编写于 作者: L Ladislau Szomoru

Fix #99022

上级 b03d23d1
......@@ -3,6 +3,7 @@
* Licensed under the MIT License. See License.txt in the project root for license information.
*--------------------------------------------------------------------------------------------*/
import { clamp } from 'vs/base/common/numbers';
import { createStyleSheet } from 'vs/base/browser/dom';
import { setGlobalSashSize } from 'vs/base/browser/ui/sash/sash';
import { Event } from 'vs/base/common/event';
......@@ -31,21 +32,19 @@ export class SashSizeController extends Disposable implements IWorkbenchContribu
}
private onDidChangeSizeConfiguration(): void {
const size = this.configurationService.getValue<number>(this.configurationName);
if (size && size >= minSize && size <= maxSize) {
// Update styles
this.stylesheet.innerHTML = `
.monaco-sash.vertical { cursor: ew-resize; top: 0; width: ${size}px; height: 100%; }
.monaco-sash.horizontal { cursor: ns-resize; left: 0; width: 100%; height: ${size}px; }
.monaco-sash:not(.disabled).orthogonal-start::before, .monaco-sash:not(.disabled).orthogonal-end::after { content: ' '; height: ${size * 2}px; width: ${size * 2}px; z-index: 100; display: block; cursor: all-scroll; position: absolute; }
.monaco-sash.orthogonal-start.vertical::before { left: -${size / 2}px; top: -${size}px; }
.monaco-sash.orthogonal-end.vertical::after { left: -${size / 2}px; bottom: -${size}px; }
.monaco-sash.orthogonal-start.horizontal::before { top: -${size / 2}px; left: -${size}px; }
.monaco-sash.orthogonal-end.horizontal::after { top: -${size / 2}px; right: -${size}px; }`;
// Update behavor
setGlobalSashSize(size);
}
const size = clamp(this.configurationService.getValue<number>(this.configurationName), minSize, maxSize) ?? minSize;
// Update styles
this.stylesheet.innerHTML = `
.monaco-sash.vertical { cursor: ew-resize; top: 0; width: ${size}px; height: 100%; }
.monaco-sash.horizontal { cursor: ns-resize; left: 0; width: 100%; height: ${size}px; }
.monaco-sash:not(.disabled).orthogonal-start::before, .monaco-sash:not(.disabled).orthogonal-end::after { content: ' '; height: ${size * 2}px; width: ${size * 2}px; z-index: 100; display: block; cursor: all-scroll; position: absolute; }
.monaco-sash.orthogonal-start.vertical::before { left: -${size / 2}px; top: -${size}px; }
.monaco-sash.orthogonal-end.vertical::after { left: -${size / 2}px; bottom: -${size}px; }
.monaco-sash.orthogonal-start.horizontal::before { top: -${size / 2}px; left: -${size}px; }
.monaco-sash.orthogonal-end.horizontal::after { top: -${size / 2}px; right: -${size}px; }`;
// Update behavor
setGlobalSashSize(size);
}
}
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册