From fde1b371d953a965dc7fd11bd8b3187dcf512f8e Mon Sep 17 00:00:00 2001 From: Tyler Leonhardt Date: Fri, 17 Jan 2025 10:13:50 -0800 Subject: [PATCH] Remove grid lines and "Presets" in wording Cleaner. --- .../browser/quickInputController.ts | 34 ------------------- .../browser/actions/layoutActions.ts | 2 +- 2 files changed, 1 insertion(+), 35 deletions(-) diff --git a/src/vs/platform/quickinput/browser/quickInputController.ts b/src/vs/platform/quickinput/browser/quickInputController.ts index f3ef3033729a4..b9ff1f3ad472c 100644 --- a/src/vs/platform/quickinput/browser/quickInputController.ts +++ b/src/vs/platform/quickinput/browser/quickInputController.ts @@ -897,9 +897,6 @@ class QuickInputDragAndDropController extends Disposable { private readonly _snapThreshold = 20; private readonly _snapLineHorizontalRatio = 0.25; - private readonly _snapLineHorizontal: HTMLElement; - private readonly _snapLineVertical1: HTMLElement; - private readonly _snapLineVertical2: HTMLElement; private _quickInputAlignmentContext = QuickInputAlignmentContextKey.bindTo(this._contextKeyService); @@ -911,22 +908,11 @@ class QuickInputDragAndDropController extends Disposable { @IContextKeyService private readonly _contextKeyService: IContextKeyService ) { super(); - - this._snapLineHorizontal = dom.append(this._container, $('.quick-input-widget-snapline.horizontal.hidden')); - this._snapLineVertical1 = dom.append(this._container, $('.quick-input-widget-snapline.vertical.hidden')); - this._snapLineVertical2 = dom.append(this._container, $('.quick-input-widget-snapline.vertical.hidden')); - this.registerMouseListeners(); } reparentUI(container: HTMLElement): void { this._container = container; - this._snapLineHorizontal.remove(); - this._snapLineVertical1.remove(); - this._snapLineVertical2.remove(); - dom.append(this._container, this._snapLineHorizontal); - dom.append(this._container, this._snapLineVertical1); - dom.append(this._container, this._snapLineVertical2); } setAlignment(alignment: 'top' | 'center' | { top: number; left: number }, done = true): void { @@ -1000,7 +986,6 @@ class QuickInputDragAndDropController extends Disposable { mouseMoveEvent.preventDefault(); if (!isMovingQuickInput) { - this._showSnapLines(snapCoordinateY, snapCoordinateX); isMovingQuickInput = true; } @@ -1036,9 +1021,6 @@ class QuickInputDragAndDropController extends Disposable { // Mouse up const mouseUpListener = dom.addDisposableGenericMouseUpListener(activeWindow, (e: MouseEvent) => { if (isMovingQuickInput) { - // Hide snaplines - this._hideSnapLines(); - // Save position const state = this.dndViewState.get(); this.dndViewState.set({ top: state?.top, left: state?.left, done: true }, undefined); @@ -1062,20 +1044,4 @@ class QuickInputDragAndDropController extends Disposable { private _getCenterXSnapValue() { return Math.round(this._container.clientWidth / 2) - Math.round(this._quickInputContainer.clientWidth / 2); } - - private _showSnapLines(horizontal: number, vertical: number) { - this._snapLineHorizontal.style.top = `${horizontal}px`; - this._snapLineVertical1.style.left = `${vertical}px`; - this._snapLineVertical2.style.left = `${vertical + this._quickInputContainer.clientWidth}px`; - - this._snapLineHorizontal.classList.remove('hidden'); - this._snapLineVertical1.classList.remove('hidden'); - this._snapLineVertical2.classList.remove('hidden'); - } - - private _hideSnapLines() { - this._snapLineHorizontal.classList.add('hidden'); - this._snapLineVertical1.classList.add('hidden'); - this._snapLineVertical2.classList.add('hidden'); - } } diff --git a/src/vs/workbench/browser/actions/layoutActions.ts b/src/vs/workbench/browser/actions/layoutActions.ts index b38c5c9a63162..d8217f384aba4 100644 --- a/src/vs/workbench/browser/actions/layoutActions.ts +++ b/src/vs/workbench/browser/actions/layoutActions.ts @@ -1491,7 +1491,7 @@ registerAction2(class CustomizeLayoutAction extends Action2 { ...AlignPanelActions.map(toQuickPickItem), { type: 'separator', - label: localize('quickOpen', "Quick Input Position Presets") + label: localize('quickOpen', "Quick Input Position") }, ...QuickInputActions.map(toQuickPickItem), {