提交 edbf4350 编写于 作者: E Eric Amodio

Fixes #104508 - adds 2px for window border

上级 b96ce60e
......@@ -16,6 +16,7 @@ import { HoverWidget as BaseHoverWidget, renderHoverAction } from 'vs/base/brows
import { Widget } from 'vs/base/browser/ui/widget';
import { AnchorPosition } from 'vs/base/browser/ui/contextview/contextview';
import { IOpenerService } from 'vs/platform/opener/common/opener';
import { IWorkbenchLayoutService } from 'vs/workbench/services/layout/browser/layoutService';
const $ = dom.$;
......@@ -48,7 +49,8 @@ export class HoverWidget extends Widget {
options: IHoverOptions,
@IKeybindingService private readonly _keybindingService: IKeybindingService,
@IConfigurationService private readonly _configurationService: IConfigurationService,
@IOpenerService private readonly _openerService: IOpenerService
@IOpenerService private readonly _openerService: IOpenerService,
@IWorkbenchLayoutService private readonly _workbenchLayoutService: IWorkbenchLayoutService,
) {
super();
......@@ -141,7 +143,7 @@ export class HoverWidget extends Widget {
// Get horizontal alignment and position
let targetLeft = this._target.x !== undefined ? this._target.x : Math.min(...targetBounds.map(e => e.left));
if (targetLeft + this._hover.containerDomNode.clientWidth >= document.documentElement.clientWidth) {
this._x = document.documentElement.clientWidth - 1;
this._x = document.documentElement.clientWidth - (this._workbenchLayoutService.hasWindowBorder() ? 3 : 1);
this._hover.containerDomNode.classList.add('right-aligned');
} else {
this._x = targetLeft;
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册