From eeedb0ae5c7c94942e8f23b6c8f00bdf92e92ff0 Mon Sep 17 00:00:00 2001 From: Ellpeck Date: Fri, 18 Sep 2020 18:19:05 +0200 Subject: [PATCH] also don't display the tooltip if all o its children are hidden --- MLEM.Ui/Elements/Tooltip.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/MLEM.Ui/Elements/Tooltip.cs b/MLEM.Ui/Elements/Tooltip.cs index d661bd1..4d71147 100644 --- a/MLEM.Ui/Elements/Tooltip.cs +++ b/MLEM.Ui/Elements/Tooltip.cs @@ -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();