提交 1d08d203 编写于 作者: A Alex Ross

Position tree markdown hovers with mouse x

上级 2f1c4b0f
......@@ -38,7 +38,7 @@ import { FuzzyScore, createMatches } from 'vs/base/common/filters';
import { CollapseAllAction } from 'vs/base/browser/ui/tree/treeDefaults';
import { isFalsyOrWhitespace } from 'vs/base/common/strings';
import { SIDE_BAR_BACKGROUND, PANEL_BACKGROUND } from 'vs/workbench/common/theme';
import { IHoverService, IHoverOptions } from 'vs/workbench/services/hover/browser/hover';
import { IHoverService, IHoverOptions, IHoverTarget } from 'vs/workbench/services/hover/browser/hover';
import { ActionViewItem } from 'vs/base/browser/ui/actionbar/actionViewItems';
class Root implements ITreeItem {
......@@ -829,8 +829,13 @@ class TreeRenderer extends Disposable implements ITreeRenderer<ITreeItem, FuzzyS
const tooltip = resolvableNode.tooltip ?? label;
if (isHovering && tooltip) {
if (!hoverOptions) {
hoverOptions = { text: isString(tooltip) ? { value: tooltip } : tooltip, target: this };
const target: IHoverTarget = {
targetElements: [this],
dispose: () => { }
};
hoverOptions = { text: isString(tooltip) ? { value: tooltip } : tooltip, target };
}
(<IHoverTarget>hoverOptions.target).x = e.x;
hoverService.showHover(hoverOptions);
}
this.removeEventListener(DOM.EventType.MOUSE_LEAVE, mouseLeave);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册