elm image, photo, plug, segment_control, thumb: Check button type and on_hold flag on mouse_down/up.
SVN revision: 79284
This commit is contained in:
parent
e23406a6c0
commit
f05a7001f1
|
@ -42,8 +42,13 @@ static void
|
|||
_on_mouse_up(void *data,
|
||||
Evas *e __UNUSED__,
|
||||
Evas_Object *obj __UNUSED__,
|
||||
void *event_info __UNUSED__)
|
||||
void *event_info)
|
||||
{
|
||||
Evas_Event_Mouse_Up *ev = event_info;
|
||||
|
||||
if (ev->button != 1) return;
|
||||
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
|
||||
|
||||
evas_object_smart_callback_call(data, SIG_CLICKED, NULL);
|
||||
}
|
||||
|
||||
|
|
|
@ -172,10 +172,13 @@ _mouse_down(void *data,
|
|||
Evas_Object *icon,
|
||||
void *event_info __UNUSED__)
|
||||
{
|
||||
Evas_Event_Mouse_Down *ev = event_info;
|
||||
|
||||
ELM_PHOTO_DATA_GET(data, sd);
|
||||
|
||||
if (sd->long_press_timer) ecore_timer_del(sd->long_press_timer);
|
||||
if (ev->button != 1) return;
|
||||
|
||||
if (sd->long_press_timer) ecore_timer_del(sd->long_press_timer);
|
||||
/* FIXME: Hard coded timeout */
|
||||
sd->long_press_timer = ecore_timer_add(0.7, _long_press_cb, data);
|
||||
evas_object_event_callback_add
|
||||
|
@ -188,8 +191,12 @@ _mouse_up(void *data,
|
|||
Evas_Object *obj __UNUSED__,
|
||||
void *event_info __UNUSED__)
|
||||
{
|
||||
Evas_Event_Mouse_Up *ev = event_info;
|
||||
ELM_PHOTO_DATA_GET(data, sd);
|
||||
|
||||
if (ev->button != 1) return;
|
||||
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
|
||||
|
||||
if (sd->long_press_timer)
|
||||
{
|
||||
ecore_timer_del(sd->long_press_timer);
|
||||
|
|
|
@ -54,8 +54,13 @@ static void
|
|||
_on_mouse_up(void *data,
|
||||
Evas *e __UNUSED__,
|
||||
Evas_Object *obj __UNUSED__,
|
||||
void *event_info __UNUSED__)
|
||||
void *event_info)
|
||||
{
|
||||
Evas_Event_Mouse_Up *ev = event_info;
|
||||
|
||||
if (ev->button != 1) return;
|
||||
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
|
||||
|
||||
evas_object_smart_callback_call(data, SIG_CLICKED, NULL);
|
||||
}
|
||||
|
||||
|
|
|
@ -311,15 +311,15 @@ _on_mouse_up(void *data,
|
|||
Evas_Object *obj __UNUSED__,
|
||||
void *event_info)
|
||||
{
|
||||
Elm_Segment_Item *it;
|
||||
Evas_Event_Mouse_Up *ev;
|
||||
Elm_Segment_Item *it = data;
|
||||
Evas_Event_Mouse_Up *ev = event_info;
|
||||
Evas_Coord x, y, w, h;
|
||||
|
||||
it = data;
|
||||
ELM_SEGMENT_CONTROL_DATA_GET(WIDGET(it), sd);
|
||||
|
||||
if (ev->button != 1) return;
|
||||
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) return;
|
||||
if (elm_widget_disabled_get(ELM_WIDGET_DATA(sd)->obj)) return;
|
||||
|
||||
if (it == sd->selected_item) return;
|
||||
|
||||
ev = event_info;
|
||||
|
@ -338,13 +338,13 @@ _on_mouse_down(void *data,
|
|||
Evas_Object *obj __UNUSED__,
|
||||
void *event_info __UNUSED__)
|
||||
{
|
||||
Elm_Segment_Item *it;
|
||||
Elm_Segment_Item *it = data;
|
||||
Evas_Event_Mouse_Down *ev = event_info;
|
||||
|
||||
it = data;
|
||||
ELM_SEGMENT_CONTROL_DATA_GET(WIDGET(it), sd);
|
||||
|
||||
if (ev->button != 1) return;
|
||||
if (elm_widget_disabled_get(ELM_WIDGET_DATA(sd)->obj)) return;
|
||||
|
||||
if (it == sd->selected_item) return;
|
||||
|
||||
edje_object_signal_emit(VIEW(it), "elm,state,segment,pressed", "elm");
|
||||
|
|
|
@ -54,12 +54,10 @@ _mouse_down_cb(void *data,
|
|||
Elm_Thumb_Smart_Data *sd = data;
|
||||
Evas_Event_Mouse_Down *ev = event_info;
|
||||
|
||||
if (ev->button != 1)
|
||||
return;
|
||||
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
|
||||
sd->on_hold = EINA_TRUE;
|
||||
else
|
||||
sd->on_hold = EINA_FALSE;
|
||||
if (ev->button != 1) return;
|
||||
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) sd->on_hold = EINA_TRUE;
|
||||
else sd->on_hold = EINA_FALSE;
|
||||
|
||||
if (ev->flags & EVAS_BUTTON_DOUBLE_CLICK)
|
||||
evas_object_smart_callback_call(obj, SIG_CLICKED_DOUBLE, NULL);
|
||||
else
|
||||
|
@ -75,12 +73,10 @@ _mouse_up_cb(void *data,
|
|||
Elm_Thumb_Smart_Data *sd = data;
|
||||
Evas_Event_Mouse_Up *ev = event_info;
|
||||
|
||||
if (ev->button != 1)
|
||||
return;
|
||||
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD)
|
||||
sd->on_hold = EINA_TRUE;
|
||||
else
|
||||
sd->on_hold = EINA_FALSE;
|
||||
if (ev->button != 1) return;
|
||||
if (ev->event_flags & EVAS_EVENT_FLAG_ON_HOLD) sd->on_hold = EINA_TRUE;
|
||||
else sd->on_hold = EINA_FALSE;
|
||||
|
||||
if (!sd->on_hold)
|
||||
evas_object_smart_callback_call(obj, SIG_CLICKED, NULL);
|
||||
|
||||
|
|
Loading…
Reference in New Issue