1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-12-24 01:09:23 +01:00

also don't display the tooltip if all o its children are hidden

This commit is contained in:
Ell 2020-09-18 18:19:05 +02:00
parent fde243ed8b
commit eeedb0ae5c

View file

@ -40,7 +40,7 @@ namespace MLEM.Ui.Elements {
if (elementToHover != null) {
elementToHover.OnMouseEnter += element => {
// only display the tooltip if there is anything in it
if (!this.Children.Any())
if (this.Children.All(c => c.IsHidden))
return;
element.System.Add(element.GetType().Name + "Tooltip", this);
this.SnapPositionToMouse();