Пример #1
0
        private void TooltipWidget_OnHovered(WidgetEvent evt, WidgetHoveredEventArgs e)
        {
            var tooltip = tooltips[evt.Listener];

            if (e.Hovered)
            {
                displayTooltip(tooltip);
            }
            else
            {
                tooltip.Displayed = false;
            }
        }
Пример #2
0
        private void widget_OnHovered(WidgetEvent evt, WidgetHoveredEventArgs e)
        {
            if (hovered == e.Hovered)
            {
                return;
            }

            hovered = e.Hovered;
            if (!disabled)
            {
                OnStateChanged?.Invoke(this, EventArgs.Empty);
            }
        }
Пример #3
0
        public bool NotifyHoveredWidgetChange(WidgetEvent evt, WidgetHoveredEventArgs e)
        {
            var related = evt.RelatedTarget;

            while (related != null && related != this)
            {
                related = related.parent;
            }

            if (related != this)
            {
                Raise(OnHovered, evt, e);
            }

            Raise(OnHoveredWidgetChange, evt, e);
            return(false);
        }
Пример #4
0
        private void changeHoveredWidget(Widget widget)
        {
            if (widget == hoveredWidget)
            {
                return;
            }

            if (hoveredWidget != null)
            {
                var e = new WidgetHoveredEventArgs(false);
                fire((w, evt) => w.NotifyHoveredWidgetChange(evt, e), hoveredWidget, widget);
            }

            var previousWidget = hoveredWidget;

            hoveredWidget = widget;

            if (hoveredWidget != null)
            {
                var e = new WidgetHoveredEventArgs(true);
                fire((w, evt) => w.NotifyHoveredWidgetChange(evt, e), hoveredWidget, previousWidget);
            }
        }