mirror of
https://github.com/microsoft/vscode.git
synced 2026-05-14 20:34:30 +01:00
fixes #52748
This commit is contained in:
@@ -159,7 +159,7 @@ export class DebugActionsWidget extends Themable implements IWorkbenchContributi
|
||||
// Prevent default to stop editor selecting text #8524
|
||||
mouseMoveEvent.preventDefault();
|
||||
// Reduce x by width of drag handle to reduce jarring #16604
|
||||
this.setCoordinates(mouseMoveEvent.posx - 14, mouseMoveEvent.posy);
|
||||
this.setCoordinates(mouseMoveEvent.posx - 14, mouseMoveEvent.posy - this.partService.getTitleBarOffset());
|
||||
}).once('mouseup', (e: MouseEvent) => {
|
||||
this.storePosition();
|
||||
this.dragArea.removeClass('dragged');
|
||||
@@ -167,8 +167,8 @@ export class DebugActionsWidget extends Themable implements IWorkbenchContributi
|
||||
});
|
||||
});
|
||||
|
||||
this.toUnbind.push(this.partService.onTitleBarVisibilityChange(() => this.positionDebugWidget()));
|
||||
this.toUnbind.push(browser.onDidChangeZoomLevel(() => this.positionDebugWidget()));
|
||||
this.toUnbind.push(this.partService.onTitleBarVisibilityChange(() => this.setYCoordinate()));
|
||||
this.toUnbind.push(browser.onDidChangeZoomLevel(() => this.setYCoordinate()));
|
||||
}
|
||||
|
||||
private storePosition(): void {
|
||||
@@ -199,10 +199,9 @@ export class DebugActionsWidget extends Themable implements IWorkbenchContributi
|
||||
}
|
||||
}
|
||||
|
||||
private positionDebugWidget(): void {
|
||||
private setYCoordinate(y = 0): void {
|
||||
const titlebarOffset = this.partService.getTitleBarOffset();
|
||||
|
||||
$(this.$el).style('top', `${titlebarOffset}px`);
|
||||
this.$el.style('top', `${titlebarOffset + y}px`);
|
||||
}
|
||||
|
||||
private setCoordinates(x?: number, y?: number): void {
|
||||
@@ -223,7 +222,7 @@ export class DebugActionsWidget extends Themable implements IWorkbenchContributi
|
||||
}
|
||||
if ((y < HEIGHT / 2) || (y > HEIGHT + HEIGHT / 2)) {
|
||||
const moveToTop = y < HEIGHT;
|
||||
this.$el.style('top', moveToTop ? '0px' : `${HEIGHT}px`);
|
||||
this.setYCoordinate(moveToTop ? 0 : HEIGHT);
|
||||
this.storageService.store(DEBUG_ACTIONS_WIDGET_Y_KEY, moveToTop ? 0 : 2 * HEIGHT, StorageScope.GLOBAL);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user