1
0
Fork 0
mirror of https://github.com/Ellpeck/MLEM.git synced 2024-11-22 20:58:34 +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) { if (elementToHover != null) {
elementToHover.OnMouseEnter += element => { elementToHover.OnMouseEnter += element => {
// only display the tooltip if there is anything in it // only display the tooltip if there is anything in it
if (!this.Children.Any()) if (this.Children.All(c => c.IsHidden))
return; return;
element.System.Add(element.GetType().Name + "Tooltip", this); element.System.Add(element.GetType().Name + "Tooltip", this);
this.SnapPositionToMouse(); this.SnapPositionToMouse();