diff --git a/legacy/elementary/data/themes/edc/elm/actionslider.edc b/legacy/elementary/data/themes/edc/elm/actionslider.edc index eb4f4bcb77..613dd925b9 100644 --- a/legacy/elementary/data/themes/edc/elm/actionslider.edc +++ b/legacy/elementary/data/themes/edc/elm/actionslider.edc @@ -42,7 +42,7 @@ group { name: "elm/actionslider/base/default"; rel2.to: "bg"; } } - part { name: "elm.text.left"; type: TEXT; mouse_events: 0; + part { name: "elm.text.left"; type: TEXT; effect: SHADOW BOTTOM; scale: 1; description { state: "default" 0.0; @@ -60,7 +60,7 @@ group { name: "elm/actionslider/base/default"; color_class: "button_text_disabled"; } } - part { name: "elm.text.center"; type: TEXT; mouse_events: 0; + part { name: "elm.text.center"; type: TEXT; effect: SHADOW BOTTOM; scale: 1; description { state: "default" 0.0; @@ -78,7 +78,7 @@ group { name: "elm/actionslider/base/default"; color_class: "button_text_disabled"; } } - part { name: "elm.text.right"; type: TEXT; mouse_events: 0; + part { name: "elm.text.right"; type: TEXT; effect: SHADOW BOTTOM; scale: 1; description { state: "default" 0.0; @@ -229,6 +229,18 @@ group { name: "elm/actionslider/base/default"; signal: "mouse,move"; source: "elm.drag_button_base"; action: SIGNAL_EMIT "elm.drag_button,mouse,move" "elm"; } + program { + signal: "mouse,down,1*"; source: "elm.text.right"; + action: SIGNAL_EMIT "elm,right,mouse,down" "elm"; + } + program { + signal: "mouse,down,1*"; source: "elm.text.left"; + action: SIGNAL_EMIT "elm,left,mouse,down" "elm"; + } + program { + signal: "mouse,down,1*"; source: "elm.text.center"; + action: SIGNAL_EMIT "elm,center,mouse,down" "elm"; + } program { signal: "elm,state,disabled"; source: "elm"; action: STATE_SET "disabled" 0.0; diff --git a/legacy/elementary/src/lib/elm_actionslider.c b/legacy/elementary/src/lib/elm_actionslider.c index bb20e2cbd6..52771d9ea4 100644 --- a/legacy/elementary/src/lib/elm_actionslider.c +++ b/legacy/elementary/src/lib/elm_actionslider.c @@ -350,6 +350,73 @@ _drag_button_up_cb(void *data, #undef _FINAL_FIX_POS_ON_MIRROREDNESS } +static void +_track_move_cb(void *data, + Evas_Object *o __UNUSED__, + const char *emission, + const char *source __UNUSED__) +{ + Evas_Object *obj = data; + + ELM_ACTIONSLIDER_DATA_GET(obj, sd); + ELM_WIDGET_DATA_GET_OR_RETURN(obj, wd); + + if (!strcmp(emission, "elm.right,mouse,down")) + { + if (sd->final_position == 0.0) + { + if (sd->enabled_position & ELM_ACTIONSLIDER_CENTER) + { + evas_object_smart_callback_call(obj, SIG_CHANGED, "center"); + sd->final_position = 0.5; + } + else if (sd->enabled_position & ELM_ACTIONSLIDER_RIGHT) + { + evas_object_smart_callback_call(obj, SIG_CHANGED, "right"); + sd->final_position = 1.0; + } + } + else if ((sd->final_position == 0.5) && + (sd->enabled_position & ELM_ACTIONSLIDER_RIGHT)) + { + evas_object_smart_callback_call(obj, SIG_CHANGED, "right"); + sd->final_position = 1.0; + } + } + else if (!strcmp(emission, "elm.center,mouse,down")) + { + if (sd->enabled_position & ELM_ACTIONSLIDER_CENTER) + { + evas_object_smart_callback_call(obj, SIG_CHANGED, "center"); + sd->final_position = 0.5; + } + } + else + { + if (sd->final_position == 1.0) + { + if (sd->enabled_position & ELM_ACTIONSLIDER_CENTER) + { + evas_object_smart_callback_call(obj, SIG_CHANGED, "center"); + sd->final_position = 0.5; + } + else if (sd->enabled_position & ELM_ACTIONSLIDER_LEFT) + { + evas_object_smart_callback_call(obj, SIG_CHANGED, "left"); + sd->final_position = 0.0; + } + } + else if (sd->final_position == 0.5 && + (sd->enabled_position & ELM_ACTIONSLIDER_LEFT)) + { + evas_object_smart_callback_call(obj, SIG_CHANGED, "left"); + sd->final_position = 0.0; + } + } + if (sd->button_animator) ecore_animator_del(sd->button_animator); + sd->button_animator = ecore_animator_add(_button_animator, obj); +} + static void _mirrored_part_fix(const Evas_Object *obj, const char **part) @@ -417,6 +484,15 @@ _elm_actionslider_smart_add(Eo *obj, void *_pd, va_list *list EINA_UNUSED) edje_object_signal_callback_add (wd->resize_obj, "elm.drag_button,mouse,move", "*", _drag_button_move_cb, obj); + edje_object_signal_callback_add + (wd->resize_obj, "elm,right,mouse,down", "*", + _track_move_cb, obj); + edje_object_signal_callback_add + (wd->resize_obj, "elm,left,mouse,down", "*", + _track_move_cb, obj); + edje_object_signal_callback_add + (wd->resize_obj, "elm,center,mouse,down", "*", + _track_move_cb, obj); if (!elm_layout_theme_set (obj, "actionslider", "base", elm_widget_style_get(obj)))