if (sd->scrollable)
{
- if (elm_widget_disabled_get(obj))
+ if (elm_widget_disabled_get(obj) && sd->callback_added)
{
evas_object_event_callback_del(obj, EVAS_CALLBACK_MOUSE_DOWN,
_on_mouse_down);
_on_mouse_up);
evas_object_event_callback_del(sd->scr_event, EVAS_CALLBACK_MOUSE_UP,
_event_mouse_up);
+
+ sd->callback_added = EINA_FALSE;
}
- else
+ else if (!elm_widget_disabled_get(obj) && !sd->callback_added)
{
evas_object_event_callback_add(obj, EVAS_CALLBACK_MOUSE_DOWN,
_on_mouse_down, sd);
_on_mouse_up, sd);
evas_object_event_callback_add(sd->scr_event, EVAS_CALLBACK_MOUSE_UP,
_event_mouse_up, obj);
+
+ sd->callback_added = EINA_TRUE;
}
}
eo_do(obj, elm_interface_scrollable_single_direction_set
(ELM_SCROLLER_SINGLE_DIRECTION_NONE));
- if (!elm_widget_disabled_get(obj))
+ if (!elm_widget_disabled_get(obj) && !sd->callback_added)
{
evas_object_event_callback_add(obj, EVAS_CALLBACK_MOUSE_DOWN,
_on_mouse_down, sd);
_on_mouse_up, sd);
evas_object_event_callback_add(sd->scr_event, EVAS_CALLBACK_MOUSE_UP,
_event_mouse_up, obj);
+
+ sd->callback_added = EINA_TRUE;
}
}
{
eo_do(obj, elm_interface_scrollable_content_set(NULL));
- evas_object_event_callback_del(obj, EVAS_CALLBACK_MOUSE_DOWN, _on_mouse_down);
- evas_object_event_callback_del(obj, EVAS_CALLBACK_MOUSE_MOVE, _on_mouse_move);
- evas_object_event_callback_del(obj, EVAS_CALLBACK_MOUSE_UP, _on_mouse_up);
- evas_object_event_callback_del(sd->scr_event, EVAS_CALLBACK_MOUSE_UP,
- _event_mouse_up);
+ if (sd->callback_added)
+ {
+ evas_object_event_callback_del(obj, EVAS_CALLBACK_MOUSE_DOWN, _on_mouse_down);
+ evas_object_event_callback_del(obj, EVAS_CALLBACK_MOUSE_MOVE, _on_mouse_move);
+ evas_object_event_callback_del(obj, EVAS_CALLBACK_MOUSE_UP, _on_mouse_up);
+ evas_object_event_callback_del(sd->scr_event, EVAS_CALLBACK_MOUSE_UP,
+ _event_mouse_up);
+
+ sd->callback_added = EINA_FALSE;
+ }
elm_widget_resize_object_set(obj, NULL, EINA_TRUE);
elm_widget_sub_object_add(obj, sd->scr_edje);