提交 559d2be8 编写于 作者: I isidor

fixes #52748

上级 b10cad5e
......@@ -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);
}
}
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册