Skip to content

Commit

Permalink
Remove grid lines and "Presets" in wording
Browse files Browse the repository at this point in the history
Cleaner.
  • Loading branch information
TylerLeonhardt committed Jan 17, 2025
1 parent f1b4bb8 commit fde1b37
Show file tree
Hide file tree
Showing 2 changed files with 1 addition and 35 deletions.
34 changes: 0 additions & 34 deletions src/vs/platform/quickinput/browser/quickInputController.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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);

Expand All @@ -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 {
Expand Down Expand Up @@ -1000,7 +986,6 @@ class QuickInputDragAndDropController extends Disposable {
mouseMoveEvent.preventDefault();

if (!isMovingQuickInput) {
this._showSnapLines(snapCoordinateY, snapCoordinateX);
isMovingQuickInput = true;
}

Expand Down Expand Up @@ -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);
Expand All @@ -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');
}
}
2 changes: 1 addition & 1 deletion src/vs/workbench/browser/actions/layoutActions.ts
Original file line number Diff line number Diff line change
Expand Up @@ -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),
{
Expand Down

0 comments on commit fde1b37

Please sign in to comment.