summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorHermet Park <hermet@hermet.pe.kr>2016-01-08 15:58:59 +0900
committerHermet Park <hermet@hermet.pe.kr>2016-01-08 15:58:59 +0900
commit060e47e169ef190d0d09fdb63ff9151d31baa4c4 (patch)
tree2a751f21d64eb0ac2fcb943fa1680b21cedf9516 /src
parentdfcdcb9af747289818b3d95ab3c689abbf2543dd (diff)
hide indicator after mouse wheel activation.
we need to customize the duration of the indicator from api or theme data. @fix T2348
Diffstat (limited to 'src')
-rw-r--r--src/lib/elm_slider.c19
-rw-r--r--src/lib/elm_widget_slider.h2
2 files changed, 21 insertions, 0 deletions
diff --git a/src/lib/elm_slider.c b/src/lib/elm_slider.c
index 73d4dcb3d..6db74da2b 100644
--- a/src/lib/elm_slider.c
+++ b/src/lib/elm_slider.c
@@ -325,6 +325,7 @@ _popup_show(void *data,
325 edje_object_signal_emit(sd->popup, "popup,show", "elm"); // XXX: for compat 325 edje_object_signal_emit(sd->popup, "popup,show", "elm"); // XXX: for compat
326 edje_object_signal_emit(sd->popup, "elm,popup,show", "elm"); 326 edje_object_signal_emit(sd->popup, "elm,popup,show", "elm");
327 } 327 }
328 ELM_SAFE_FREE(sd->wheel_indicator_timer, ecore_timer_del);
328} 329}
329 330
330static void 331static void
@@ -412,6 +413,16 @@ _key_action_drag(Evas_Object *obj, const char *params)
412 return EINA_TRUE; 413 return EINA_TRUE;
413} 414}
414 415
416static Eina_Bool
417_wheel_indicator_timer_cb(void *data)
418{
419 ELM_SLIDER_DATA_GET(data, sd);
420 sd->wheel_indicator_timer = NULL;
421
422 _popup_hide(data, NULL, NULL, NULL);
423 return ECORE_CALLBACK_CANCEL;
424}
425
415EOLIAN static Eina_Bool 426EOLIAN static Eina_Bool
416_elm_slider_elm_widget_event(Eo *obj, Elm_Slider_Data *sd EINA_UNUSED, Evas_Object *src, Evas_Callback_Type type, void *event_info) 427_elm_slider_elm_widget_event(Eo *obj, Elm_Slider_Data *sd EINA_UNUSED, Evas_Object *src, Evas_Callback_Type type, void *event_info)
417{ 428{
@@ -439,6 +450,12 @@ _elm_slider_elm_widget_event(Eo *obj, Elm_Slider_Data *sd EINA_UNUSED, Evas_Obje
439 if (mev->z < 0) _drag_up(obj, NULL, NULL, NULL); 450 if (mev->z < 0) _drag_up(obj, NULL, NULL, NULL);
440 else _drag_down(obj, NULL, NULL, NULL); 451 else _drag_down(obj, NULL, NULL, NULL);
441 mev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD; 452 mev->event_flags |= EVAS_EVENT_FLAG_ON_HOLD;
453 _popup_show(obj, NULL, NULL, NULL);
454 _slider_update(obj, EINA_TRUE);
455 sd->wheel_indicator_timer =
456 ecore_timer_add(0.5, _wheel_indicator_timer_cb, obj);
457 return EINA_TRUE;
458
442 } 459 }
443 else return EINA_FALSE; 460 else return EINA_FALSE;
444 461
@@ -857,6 +874,8 @@ _elm_slider_evas_object_smart_add(Eo *obj, Elm_Slider_Data *priv)
857 priv->indicator_show = EINA_TRUE; 874 priv->indicator_show = EINA_TRUE;
858 priv->indicator_visible_mode = elm_config_slider_indicator_visible_mode_get(); 875 priv->indicator_visible_mode = elm_config_slider_indicator_visible_mode_get();
859 priv->val_max = 1.0; 876 priv->val_max = 1.0;
877 //TODO: customize this time duration from api or theme data.
878 priv->wheel_indicator_duration = 0.25;
860 priv->step = SLIDER_STEP; 879 priv->step = SLIDER_STEP;
861 880
862 if (!elm_layout_theme_set 881 if (!elm_layout_theme_set
diff --git a/src/lib/elm_widget_slider.h b/src/lib/elm_widget_slider.h
index ecb96dc28..49ebd8aed 100644
--- a/src/lib/elm_widget_slider.h
+++ b/src/lib/elm_widget_slider.h
@@ -40,6 +40,8 @@ struct _Elm_Slider_Data
40 40
41 double val, val_min, val_max, val2, step; 41 double val, val_min, val_max, val2, step;
42 42
43 Ecore_Timer *wheel_indicator_timer;
44 double wheel_indicator_duration;
43 Elm_Slider_Indicator_Visible_Mode indicator_visible_mode; /**< indicator_visible_mode of the slider. 45 Elm_Slider_Indicator_Visible_Mode indicator_visible_mode; /**< indicator_visible_mode of the slider.
44 This indicates when to show an indicator */ 46 This indicates when to show an indicator */
45 47