1
0
Fork 0
mirror of https://github.com/davatorium/rofi.git synced 2024-11-11 13:50:48 -05:00
rofi/source/widget.c

25 lines
492 B
C
Raw Normal View History

#include <glib.h>
#include "widget.h"
2016-01-09 13:25:03 -05:00
int widget_intersect ( const Widget *widget, int x, int y )
{
2016-01-09 13:25:03 -05:00
if ( widget == NULL ) {
return FALSE;
}
if ( x >= ( widget->x ) && x < ( widget->x + widget->w ) ) {
if ( y >= ( widget->y ) && y < ( widget->y + widget->h ) ) {
return TRUE;
}
}
return FALSE;
}
2016-01-09 13:25:03 -05:00
void widget_move ( Widget *widget, short x, short y )
{
2016-01-09 13:25:03 -05:00
if ( widget != NULL ) {
widget->x = x;
2016-01-09 13:25:03 -05:00
widget->y = y;
}
}