mirror of
https://github.com/lbonn/rofi
synced 2024-11-15 00:27:36 +00:00
24 lines
492 B
C
24 lines
492 B
C
#include <glib.h>
|
|
#include "widget.h"
|
|
|
|
int widget_intersect ( const Widget *widget, int x, int y )
|
|
{
|
|
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;
|
|
}
|
|
|
|
void widget_move ( Widget *widget, short x, short y )
|
|
{
|
|
if ( widget != NULL ) {
|
|
widget->x = x;
|
|
widget->y = y;
|
|
}
|
|
}
|