const char *emission, const char *source);
static Eina_Bool _event_hook(Evas_Object *obj, Evas_Object *src,
Evas_Callback_Type type, void *event_info);
+static void _spacer_cb(void *data, Evas * e, Evas_Object * obj, void *event_info);
static const char SIG_CHANGED[] = "changed";
static const char SIG_DELAY_CHANGED[] = "delay,changed";
edje_object_part_drag_step(wd->slider, "elm.dragable.slider", step, step);
}
+static void
+_spacer_cb(void *data, Evas * e, Evas_Object * obj, void *event_info)
+{
+ Widget_Data *wd = elm_widget_data_get(data);
+ Evas_Event_Mouse_Down *ev = event_info;
+ Evas_Coord x, y, w, h;
+ double button_x, button_y;
+
+ evas_object_geometry_get(wd->spacer, &x, &y, &w, &h);
+ edje_object_part_drag_value_get(wd->slider, "elm.dragable.slider", &button_x, &button_y);
+ if(wd->horizontal)
+ {
+ button_x = ((double)ev->output.x - (double)x) / (double)w;
+ if (button_x > 1) button_x = 1;
+ if (button_x < 0) button_x = 0;
+ }
+ else
+ {
+ button_y = ((double)ev->output.y - (double)y) / (double)h;
+ if (button_y > 1) button_y = 1;
+ if (button_y < 0) button_y = 0;
+ }
+ edje_object_part_drag_value_set(wd->slider, "elm.dragable.slider", button_x, button_y);
+ evas_event_feed_mouse_cancel(e, 0, NULL);
+ evas_event_feed_mouse_down(e, 1, EVAS_BUTTON_NONE, 0, NULL);
+}
+
/**
* Add a new slider to the parent
*
evas_object_pass_events_set(wd->spacer, EINA_TRUE);
elm_widget_sub_object_add(obj, wd->spacer);
edje_object_part_swallow(wd->slider, "elm.swallow.bar", wd->spacer);
-
+ evas_object_event_callback_add(wd->spacer, EVAS_CALLBACK_MOUSE_DOWN, _spacer_cb, obj);
evas_object_smart_callback_add(obj, "sub-object-del", _sub_del, obj);
_sizing_eval(obj);