public virtual void OnPointerEnter(IGuiContext context, GuiPointerEventArgs args)
 {
     if (IsEnabled)
     {
         HoverStyle?.Apply(this);
     }
 }
Beispiel #2
0
 public virtual bool OnPointerEnter(IGuiContext context, GuiPointerEventArgs args)
 {
     if (IsEnabled && !_isHovering)
     {
         _isHovering = true;
         HoverStyle?.Apply(this);
     }
     return(true);
 }
        public override bool OnPointerUp(IGuiContext context, PointerEventArgs args)
        {
            base.OnPointerUp(context, args);

            if (BoundingRectangle.Contains(args.Position))
            {
                HoverStyle?.Revert(this);
                CheckedHoverStyle?.Revert(this);

                IsChecked = !IsChecked;

                if (IsChecked)
                {
                    CheckedHoverStyle?.Apply(this);
                }
                else
                {
                    HoverStyle?.Apply(this);
                }
            }

            return(true);
        }