2014-11-29 8:06 GMT+01:00 Anil Kumar Nahak <[email protected]>: > raster pushed a commit to branch master. > > > http://git.enlightenment.org/core/elementary.git/commit/?id=65240b5327e5ab1eb8f77835b4729444fe1f02df > > commit 65240b5327e5ab1eb8f77835b4729444fe1f02df > Author: Anil Kumar Nahak <[email protected]> > Date: Sat Nov 29 15:56:45 2014 +0900 > > Slider: Added APIs to set/get slider's indicator visibility mode. > > Summary: > elm_config_slider_indicator_visible_mode_set > elm_config_slider_indicator_visible_mode_get >
Shouldn't this be since 1.13 ? the docs say 1.12 > > The patch will enable the slider's indicator to get > > visible always > visible on focus > visible never > visible on slider value change > > Reviewers: raster, seoz > > Subscribers: sachin.dev > > Differential Revision: https://phab.enlightenment.org/D1558 > --- > config/default/base.src.in | 1 + > config/mobile/base.src.in | 1 + > config/standard/base.src.in | 1 + > src/lib/elm_config.c | 26 +++++++++++++++++++++++++- > src/lib/elm_config.h | 40 ++++++++++++++++++++++++++++++++++++++++ > src/lib/elm_priv.h | 1 + > src/lib/elm_slider.c | 36 ++++++++++++++++++++++++++---------- > 7 files changed, 95 insertions(+), 11 deletions(-) > > diff --git a/config/default/base.src.in b/config/default/base.src.in > index 64b2783..35f9984 100644 > --- a/config/default/base.src.in > +++ b/config/default/base.src.in > @@ -27,6 +27,7 @@ group "Elm_Config" struct { > value "scroll_smooth_future_time" double: 0.0; > value "scroll_smooth_time_window" double: 0.01; > value "focus_autoscroll_mode" uchar: 0; > + value "slider_indicator_visible_mode" int: 0; > value "scale" double: 1.0; > value "bgpixmap" int: 0; > value "compositing" int: 1; > diff --git a/config/mobile/base.src.in b/config/mobile/base.src.in > index ff66243..4e4afd4 100644 > --- a/config/mobile/base.src.in > +++ b/config/mobile/base.src.in > @@ -27,6 +27,7 @@ group "Elm_Config" struct { > value "scroll_smooth_future_time" double: 0.0; > value "scroll_smooth_time_window" double: 0.01; > value "focus_autoscroll_mode" uchar: 0; > + value "slider_indicator_visible_mode" int: 0; > value "scale" double: 1.0; > value "bgpixmap" int: 0; > value "compositing" int: 1; > diff --git a/config/standard/base.src.in b/config/standard/base.src.in > index 7df9437..e55f879 100644 > --- a/config/standard/base.src.in > +++ b/config/standard/base.src.in > @@ -27,6 +27,7 @@ group "Elm_Config" struct { > value "scroll_smooth_future_time" double: 0.0; > value "scroll_smooth_time_window" double: 0.01; > value "focus_autoscroll_mode" uchar: 0; > + value "slider_indicator_visible_mode" int: 0; > value "scale" double: 1.0; > value "bgpixmap" int: 0; > value "compositing" int: 1; > diff --git a/src/lib/elm_config.c b/src/lib/elm_config.c > index 661aaf8..5ddea1e 100644 > --- a/src/lib/elm_config.c > +++ b/src/lib/elm_config.c > @@ -529,6 +529,7 @@ _desc_init(void) > ELM_CONFIG_VAL(D, T, focus_highlight_clip_disable, T_UCHAR); > ELM_CONFIG_VAL(D, T, focus_move_policy, T_UCHAR); > ELM_CONFIG_VAL(D, T, focus_autoscroll_mode, T_UCHAR); > + ELM_CONFIG_VAL(D, T, slider_indicator_visible_mode, T_INT); > ELM_CONFIG_VAL(D, T, item_select_on_focus_disable, T_UCHAR); > ELM_CONFIG_VAL(D, T, first_item_focus_on_first_focus_in, T_UCHAR); > ELM_CONFIG_VAL(D, T, toolbar_shrink_mode, T_INT); > @@ -1992,7 +1993,18 @@ _env_get(void) > else > _elm_config->focus_autoscroll_mode = > ELM_FOCUS_AUTOSCROLL_MODE_SHOW; > } > - > + s = getenv("ELM_SLIDER_INDICATOR_VISIBLE_MODE"); > + if (s) > + { > + if (!strcmp(s, "ELM_SLIDER_INDICATOR_VISIBLE_MODE_DEFAULT")) > + _elm_config->slider_indicator_visible_mode = > ELM_SLIDER_INDICATOR_VISIBLE_MODE_DEFAULT; > + else if (!strcmp(s, "ELM_SLIDER_INDICATOR_VISIBLE_MODE_ALWAYS")) > + _elm_config->slider_indicator_visible_mode = > ELM_SLIDER_INDICATOR_VISIBLE_MODE_ALWAYS; > + else if (!strcmp(s, "ELM_SLIDER_INDICATOR_VISIBLE_MODE_ON_FOCUS")) > + _elm_config->slider_indicator_visible_mode = > ELM_SLIDER_INDICATOR_VISIBLE_MODE_ON_FOCUS; > + else > + _elm_config->slider_indicator_visible_mode = > ELM_SLIDER_INDICATOR_VISIBLE_MODE_NONE; > + } > s = getenv("ELM_THEME"); > if (s) eina_stringshare_replace(&_elm_config->theme, s); > > @@ -2957,6 +2969,18 @@ elm_config_focus_autoscroll_mode_get(void) > } > > EAPI void > +elm_config_slider_indicator_visible_mode_set(Elm_Slider_Indicator_Visible_Mode > mode) > +{ > + _elm_config->slider_indicator_visible_mode = mode; > +} > + > +EAPI Elm_Slider_Indicator_Visible_Mode > +elm_config_slider_indicator_visible_mode_get(void) > +{ > + return _elm_config->slider_indicator_visible_mode; > +} > + > +EAPI void > elm_config_focus_autoscroll_mode_set(Elm_Focus_Autoscroll_Mode mode) > { > _elm_config->focus_autoscroll_mode = mode; > diff --git a/src/lib/elm_config.h b/src/lib/elm_config.h > index ae16b4d..7da1f58 100644 > --- a/src/lib/elm_config.h > +++ b/src/lib/elm_config.h > @@ -595,6 +595,46 @@ EAPI Elm_Focus_Autoscroll_Mode > elm_config_focus_autoscroll_mode_get(void); > EAPI void > elm_config_focus_autoscroll_mode_set(Elm_Focus_Autoscroll_Mode mode); > > /** > + * Slider's indicator visiblity mode. > + * > + * @since 1.12 > + * @ingroup Slider > + */ > + > +typedef enum > +{ > + ELM_SLIDER_INDICATOR_VISIBLE_MODE_DEFAULT, /**< show indicator on > mouse down or change in slider value */ > + ELM_SLIDER_INDICATOR_VISIBLE_MODE_ALWAYS, /**< Always show the > indicator. */ > + ELM_SLIDER_INDICATOR_VISIBLE_MODE_ON_FOCUS, /**< Show the indicator > on focus */ > + ELM_SLIDER_INDICATOR_VISIBLE_MODE_NONE /**< Never show the > indicator */ > +} Elm_Slider_Indicator_Visible_Mode; > + > +/** > + * Sets the slider's indicator visible mode. > + * > + * @param obj The slider object. > + * @param mode Elm_Slider_Indicator_Visible_Mode. > + * viewport. > + * > + * @ingroup Slider > + * @since 1.12 > + */ > +EAPI void > elm_config_slider_indicator_visible_mode_set(Elm_Slider_Indicator_Visible_Mode > mode); > + > +/** > + * Get the slider's indicator visible mode. > + * > + * @param obj The slider object. > + * @return @c ELM_SLIDER_INDICATOR_VISIBLE_MODE_DEFAULT if not set > anything by the user. > + * @c ELM_SLIDER_INDICATOR_VISIBLE_MODE_ALWAYS, > ELM_SLIDER_INDICATOR_VISIBLE_MODE_ON_FOCUS, > + * ELM_SLIDER_INDICATOR_VISIBLE_MODE_NONE if any of the above is set > by user. > + * > + * @ingroup Slider > + * @since 1.12 > + */ > +EAPI Elm_Slider_Indicator_Visible_Mode > elm_config_slider_indicator_visible_mode_get(void); > + > +/** > * @} > */ > > diff --git a/src/lib/elm_priv.h b/src/lib/elm_priv.h > index 5d1c6fa..719cbf1 100644 > --- a/src/lib/elm_priv.h > +++ b/src/lib/elm_priv.h > @@ -231,6 +231,7 @@ struct _Elm_Config > unsigned char item_select_on_focus_disable; /**< This shows the > disabled status of select on focus feature. This value is false by default > so that select on focus feature is enabled by default.*/ > unsigned char first_item_focus_on_first_focus_in; /**< This sets the > first item focus on first focus in feature*/ > Elm_Focus_Autoscroll_Mode focus_autoscroll_mode; /**< This shows the > focus auto scroll mode. By default, @c ELM_FOCUS_AUTOSCROLL_MODE_SHOW is > set. */ > + Elm_Slider_Indicator_Visible_Mode slider_indicator_visible_mode; > /**< this sets the slider indicator visible mode */ > int toolbar_shrink_mode; > unsigned char fileselector_expand_enable; > unsigned char fileselector_double_tap_navigation_enable; > diff --git a/src/lib/elm_slider.c b/src/lib/elm_slider.c > index 82707ec..6d11d23 100644 > --- a/src/lib/elm_slider.c > +++ b/src/lib/elm_slider.c > @@ -308,7 +308,7 @@ _popup_show(void *data, > const char *source EINA_UNUSED) > { > ELM_SLIDER_DATA_GET(data, sd); > - if (sd->popup) > + if (sd->popup && _elm_config->slider_indicator_visible_mode != > ELM_SLIDER_INDICATOR_VISIBLE_MODE_NONE) > { > evas_object_raise(sd->popup); > evas_object_show(sd->popup); > @@ -328,7 +328,10 @@ _popup_hide(void *data, > > if (!sd->popup_visible || !sd->popup) return; > > - if (!(elm_widget_focus_get(data) && sd->always_popup_show)) > + if (_elm_config->slider_indicator_visible_mode == > ELM_SLIDER_INDICATOR_VISIBLE_MODE_ALWAYS) return; > + > + if (!((elm_widget_focus_get(data)) && > + (_elm_config->slider_indicator_visible_mode == > ELM_SLIDER_INDICATOR_VISIBLE_MODE_ON_FOCUS))) > { > // XXX: for compat > edje_object_signal_emit(sd->popup, "popup,hide", "elm"); > @@ -345,7 +348,8 @@ _popup_hide_done(void *data, > ELM_SLIDER_DATA_GET(data, sd); > if (sd->popup) > { > - if (!(elm_widget_focus_get(data) && sd->always_popup_show)) > + if (!((elm_widget_focus_get(data)) && > + (_elm_config->slider_indicator_visible_mode == > ELM_SLIDER_INDICATOR_VISIBLE_MODE_ON_FOCUS))) > { > evas_object_hide(sd->popup); > sd->popup_visible = EINA_FALSE; > @@ -823,6 +827,16 @@ _access_state_cb(void *data EINA_UNUSED, Evas_Object > *obj) > return NULL; > } > > +static void > +_on_show(void *data EINA_UNUSED, > + Evas *e EINA_UNUSED, > + Evas_Object *obj, > + void *event_info EINA_UNUSED) > +{ > + if (_elm_config->slider_indicator_visible_mode == > ELM_SLIDER_INDICATOR_VISIBLE_MODE_ALWAYS) > + _popup_show(obj, NULL, NULL, NULL); > +} > + > EOLIAN static void > _elm_slider_evas_object_smart_add(Eo *obj, Elm_Slider_Data *priv) > { > @@ -867,6 +881,8 @@ _elm_slider_evas_object_smart_add(Eo *obj, > Elm_Slider_Data *priv) > evas_object_event_callback_add > (priv->spacer, EVAS_CALLBACK_MOUSE_UP, _spacer_up_cb, obj); > > + evas_object_event_callback_add(obj, EVAS_CALLBACK_SHOW, _on_show, > NULL); > + > elm_widget_can_focus_set(obj, EINA_TRUE); > > _elm_access_object_register(obj, wd->resize_obj); > @@ -1143,18 +1159,18 @@ _elm_slider_step_get(Eo *obj EINA_UNUSED, > Elm_Slider_Data *sd) > } > > EOLIAN static void > -_elm_slider_indicator_show_on_focus_set(Eo *obj EINA_UNUSED, > Elm_Slider_Data *sd, Eina_Bool flag) > +_elm_slider_indicator_show_on_focus_set(Eo *obj EINA_UNUSED, > Elm_Slider_Data *sd EINA_UNUSED, Eina_Bool flag) > { > if (flag) > - sd->always_popup_show = EINA_TRUE; > + > > elm_config_slider_indicator_visible_mode_set(ELM_SLIDER_INDICATOR_VISIBLE_MODE_ON_FOCUS); > else > - sd->always_popup_show = EINA_FALSE; > + > > elm_config_slider_indicator_visible_mode_set(ELM_SLIDER_INDICATOR_VISIBLE_MODE_DEFAULT); > } > > EOLIAN static Eina_Bool > -_elm_slider_indicator_show_on_focus_get(Eo *obj EINA_UNUSED, > Elm_Slider_Data *sd) > +_elm_slider_indicator_show_on_focus_get(Eo *obj EINA_UNUSED, > Elm_Slider_Data *sd EINA_UNUSED) > { > - return sd->always_popup_show; > + return (elm_config_slider_indicator_visible_mode_get() == > ELM_SLIDER_INDICATOR_VISIBLE_MODE_ON_FOCUS); > } > > EOLIAN static Eina_Bool > @@ -1170,13 +1186,13 @@ > _elm_slider_elm_widget_focus_direction_manager_is(Eo *obj EINA_UNUSED, > Elm_Slide > } > > EOLIAN static Eina_Bool > -_elm_slider_elm_widget_on_focus(Eo *obj, Elm_Slider_Data *sd) > +_elm_slider_elm_widget_on_focus(Eo *obj, Elm_Slider_Data *sd EINA_UNUSED) > { > Eina_Bool int_ret = EINA_FALSE; > > eo_do_super(obj, MY_CLASS, int_ret = elm_obj_widget_on_focus()); > > - if (sd->always_popup_show && elm_widget_focus_get(obj)) > + if ((_elm_config->slider_indicator_visible_mode == > ELM_SLIDER_INDICATOR_VISIBLE_MODE_ON_FOCUS) && elm_widget_focus_get(obj)) > _popup_show(obj, NULL, NULL, NULL); > else > _popup_hide(obj, NULL, NULL, NULL); > > -- > > > ------------------------------------------------------------------------------ New Year. New Location. New Benefits. New Data Center in Ashburn, VA. GigeNET is offering a free month of service with a new server in Ashburn. Choose from 2 high performing configs, both with 100TB of bandwidth. Higher redundancy.Lower latency.Increased capacity.Completely compliant. http://p.sf.net/sfu/gigenet _______________________________________________ enlightenment-devel mailing list [email protected] https://lists.sourceforge.net/lists/listinfo/enlightenment-devel
