mirror of
https://github.com/Ellpeck/MLEM.git
synced 2024-11-26 14:38:34 +01:00
only display the tooltip if there is anything in it
This commit is contained in:
parent
2342eb093a
commit
fde243ed8b
1 changed files with 4 additions and 0 deletions
|
@ -1,4 +1,5 @@
|
||||||
using System;
|
using System;
|
||||||
|
using System.Linq;
|
||||||
using Microsoft.Xna.Framework;
|
using Microsoft.Xna.Framework;
|
||||||
using MLEM.Ui.Style;
|
using MLEM.Ui.Style;
|
||||||
|
|
||||||
|
@ -38,6 +39,9 @@ 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
|
||||||
|
if (!this.Children.Any())
|
||||||
|
return;
|
||||||
element.System.Add(element.GetType().Name + "Tooltip", this);
|
element.System.Add(element.GetType().Name + "Tooltip", this);
|
||||||
this.SnapPositionToMouse();
|
this.SnapPositionToMouse();
|
||||||
};
|
};
|
||||||
|
|
Loading…
Reference in a new issue