Beispiel #1
0
/******************************************************************************\
 Find which button is being hovered over and configure the detail window.
\******************************************************************************/
static void detail_hover(void)
{
        int i;

        /* Find which button we are hovering over */
        for (i = 0; i < I_RING_ICONS; i++) {
                if (!button_widgets[i].widget.shown ||
                    !C_rect_contains(button_widgets[i].widget.origin,
                                     button_widgets[i].widget.size,
                                     i_mouse))
                        continue;

                /* Same button as before */
                if (detail_button == i)
                        return;

                /* Button changed, start a new hover timer */
                I_widget_event(&detail_window.widget, I_EV_HIDE);
                detail_button = i;
                detail_time = c_time_msec;
                return;
        }

        /* Missed all the buttons, close it */
        I_widget_event(&detail_window.widget, I_EV_HIDE);
        detail_button = -1;
        detail_time = 0;
}
Beispiel #2
0
/******************************************************************************\
 Returns TRUE if [widget] meets criteria for mouse focus.
\******************************************************************************/
static bool can_mouse_focus(i_widget_t *widget)
{
        return widget->state != I_WS_NO_FOCUS &&
               widget->state != I_WS_DISABLED && widget->shown &&
               C_rect_contains(widget->origin, widget->size, i_mouse);
}