Fix showing tooltips for tree nodes in Editor

This commit is contained in:
Wojciech Figat
2021-12-09 17:08:39 +01:00
parent 4a8291d596
commit fcb9bbbe72
2 changed files with 27 additions and 11 deletions

View File

@@ -148,7 +148,6 @@ namespace FlaxEditor.GUI.Tree
else if (Parent is Tree tree)
_tree = tree;
}
return _tree;
}
}
@@ -613,12 +612,6 @@ namespace FlaxEditor.GUI.Tree
{
base.Update(deltaTime);
}
else
{
// Manually update tooltip
if (TooltipText != null && IsMouseOver)
Tooltip.OnMouseOverControl(this, deltaTime);
}
}
/// <inheritdoc />
@@ -1006,6 +999,21 @@ namespace FlaxEditor.GUI.Tree
base.OnDragLeave();
}
/// <inheritdoc />
public override bool OnTestTooltipOverControl(ref Vector2 location)
{
return TestHeaderHit(ref location) && ShowTooltip;
}
/// <inheritdoc />
public override bool OnShowTooltip(out string text, out Vector2 location, out Rectangle area)
{
text = TooltipText;
location = _headerRect.Size * new Vector2(0.5f, 1.0f);
area = new Rectangle(Vector2.Zero, _headerRect.Size);
return ShowTooltip;
}
/// <inheritdoc />
protected override void OnSizeChanged()
{