internal static void AddTooltip(this VisualElement e, string tooltip)
 {
     if (string.IsNullOrEmpty(tooltip))
     {
         e.RemoveTooltip();
     }
     else
     {
         TooltipElement tooltipElement = e.Query().Children <TooltipElement>(null, null);
         if (tooltipElement == null)
         {
             tooltipElement = new TooltipElement();
         }
         tooltipElement.style.positionType = PositionType.Absolute;
         IStyle             arg_85_0   = tooltipElement.style;
         StyleValue <float> styleValue = 0f;
         tooltipElement.style.positionBottom = styleValue;
         styleValue = styleValue;
         tooltipElement.style.positionTop = styleValue;
         styleValue = styleValue;
         tooltipElement.style.positionRight = styleValue;
         arg_85_0.positionLeft  = styleValue;
         tooltipElement.tooltip = tooltip;
         e.Add(tooltipElement);
     }
 }
Beispiel #2
0
        internal static void RemoveTooltip(this VisualElement e)
        {
            TooltipElement tooltipElement = e.Query().Children <TooltipElement>();

            if (tooltipElement != null)
            {
                e.Remove(tooltipElement);
            }
        }
Beispiel #3
0
        internal static void AddTooltip(this VisualElement e, string tooltip)
        {
            if (string.IsNullOrEmpty(tooltip))
            {
                RemoveTooltip(e);
                return;
            }
            TooltipElement tooltipElement = e.Query().Children <TooltipElement>();

            if (tooltipElement == null)
            {
                tooltipElement = new TooltipElement();
            }

            tooltipElement.style.positionType = PositionType.Absolute;
            tooltipElement.style.positionLeft = tooltipElement.style.positionRight = tooltipElement.style.positionTop = tooltipElement.style.positionBottom = 0;

            tooltipElement.tooltip = tooltip;

            e.Add(tooltipElement);
        }