Efl.Ui.Slider: make indicator_show_on_focus/indicator_show() legacy APIs

Ref T6376
This commit is contained in:
Amitesh Singh 2017-11-16 10:12:51 +09:00
parent 28d74624ec
commit 77164413cd
3 changed files with 98 additions and 73 deletions

View File

@ -1229,37 +1229,6 @@ _efl_ui_slider_efl_ui_range_range_value_get(Eo *obj EINA_UNUSED, Efl_Ui_Slider_D
return sd->val;
}
EOLIAN static void
_efl_ui_slider_indicator_show_set(Eo *obj, Efl_Ui_Slider_Data *sd, Eina_Bool show)
{
if (show)
{
sd->indicator_show = EINA_TRUE;
elm_layout_signal_emit(obj, "elm,state,val,show", "elm");
if (sd->popup)
edje_object_signal_emit(sd->popup, "elm,state,val,show", "elm");
if (sd->popup2)
edje_object_signal_emit(sd->popup2, "elm,state,val,show", "elm");
}
else
{
sd->indicator_show = EINA_FALSE;
elm_layout_signal_emit(obj, "elm,state,val,hide", "elm");
if (sd->popup)
edje_object_signal_emit(sd->popup, "elm,state,val,hide", "elm");
if (sd->popup2)
edje_object_signal_emit(sd->popup2, "elm,state,val,hide", "elm");
}
evas_object_smart_changed(obj);
}
EOLIAN static Eina_Bool
_efl_ui_slider_indicator_show_get(Eo *obj EINA_UNUSED, Efl_Ui_Slider_Data *sd)
{
return sd->indicator_show;
}
EOLIAN static void
_efl_ui_slider_step_set(Eo *obj EINA_UNUSED, Efl_Ui_Slider_Data *sd, double step)
{
@ -1277,21 +1246,6 @@ _efl_ui_slider_step_get(Eo *obj EINA_UNUSED, Efl_Ui_Slider_Data *sd)
return sd->step;
}
EOLIAN static void
_efl_ui_slider_indicator_show_on_focus_set(Eo *obj EINA_UNUSED, Efl_Ui_Slider_Data *sd, Eina_Bool flag)
{
if (flag)
sd->indicator_visible_mode = ELM_SLIDER_INDICATOR_VISIBLE_MODE_ON_FOCUS;
else
sd->indicator_visible_mode = ELM_SLIDER_INDICATOR_VISIBLE_MODE_DEFAULT;
}
EOLIAN static Eina_Bool
_efl_ui_slider_indicator_show_on_focus_get(Eo *obj EINA_UNUSED, Efl_Ui_Slider_Data *sd)
{
return (sd->indicator_visible_mode == ELM_SLIDER_INDICATOR_VISIBLE_MODE_ON_FOCUS);
}
EOLIAN static void
_efl_ui_slider_indicator_visible_mode_set(Eo *obj EINA_UNUSED, Efl_Ui_Slider_Data *sd, Elm_Slider_Indicator_Visible_Mode indicator_visible_mode)
{
@ -1740,6 +1694,58 @@ elm_slider_indicator_format_function_set(Evas_Object *obj, slider_func_type func
_format_legacy_to_format_eo_free_cb);
}
EAPI void
elm_slider_indicator_show_on_focus_set(Evas_Object *obj, Eina_Bool flag)
{
EFL_UI_SLIDER_DATA_GET_OR_RETURN(obj, sd);
if (flag)
sd->indicator_visible_mode = ELM_SLIDER_INDICATOR_VISIBLE_MODE_ON_FOCUS;
else
sd->indicator_visible_mode = ELM_SLIDER_INDICATOR_VISIBLE_MODE_DEFAULT;
}
EAPI Eina_Bool
elm_slider_indicator_show_on_focus_get(const Evas_Object *obj)
{
EFL_UI_SLIDER_DATA_GET_OR_RETURN(obj, sd, EINA_FALSE);
return (sd->indicator_visible_mode == ELM_SLIDER_INDICATOR_VISIBLE_MODE_ON_FOCUS);
}
EAPI void
elm_slider_indicator_show_set(Evas_Object *obj, Eina_Bool show)
{
EFL_UI_SLIDER_DATA_GET_OR_RETURN(obj, sd);
if (show)
{
sd->indicator_show = EINA_TRUE;
elm_layout_signal_emit(obj, "elm,state,val,show", "elm");
if (sd->popup)
edje_object_signal_emit(sd->popup, "elm,state,val,show", "elm");
if (sd->popup2)
edje_object_signal_emit(sd->popup2, "elm,state,val,show", "elm");
}
else
{
sd->indicator_show = EINA_FALSE;
elm_layout_signal_emit(obj, "elm,state,val,hide", "elm");
if (sd->popup)
edje_object_signal_emit(sd->popup, "elm,state,val,hide", "elm");
if (sd->popup2)
edje_object_signal_emit(sd->popup2, "elm,state,val,hide", "elm");
}
evas_object_smart_changed(obj);
}
EAPI Eina_Bool
elm_slider_indicator_show_get(const Evas_Object *obj)
{
EFL_UI_SLIDER_DATA_GET_OR_RETURN(obj, sd, EINA_FALSE);
return sd->indicator_show;
}
/* Internal EO APIs and hidden overrides */
ELM_LAYOUT_CONTENT_ALIASES_IMPLEMENT(efl_ui_slider)

View File

@ -8,33 +8,6 @@ class Efl.Ui.Slider (Efl.Ui.Layout, Efl.Ui.Range, Efl.Ui.Direction,
[[Elementary slider class]]
legacy_prefix: elm_slider;
methods {
@property indicator_show {
set {
[[Set whether to enlarge slider indicator (augmented knob) or not.
By default, indicator will be bigger while dragged by the user.
]]
}
get {
[[Get whether a given slider widget's enlarging indicator or not.]]
}
values {
show: bool; [[$true will make it enlarge, $false will
let the knob always at default size.]]
}
}
@property indicator_show_on_focus {
set {
[[Show the indicator of slider on focus.]]
}
get {
[[Get whether the indicator of the slider is set or not.]]
}
values {
flag: bool; [[$true if indicator is shown on focus, $false otherwise]]
}
}
@property step {
set {
[[Set the step by which slider indicator will move.

View File

@ -283,4 +283,50 @@ EAPI void elm_slider_range_get(const Evas_Object *obj, double *from, double *to)
*/
EAPI void elm_slider_indicator_format_function_set(Evas_Object *obj, slider_func_type func, slider_freefunc_type free_func);
/**
* @brief Show the indicator of slider on focus.
*
* @param[in] obj The object.
* @param[in] flag @c true if indicator is shown on focus, @c false otherwise
*
* @ingroup Elm_Slider
*/
EAPI void elm_slider_indicator_show_on_focus_set(Evas_Object *obj, Eina_Bool flag);
/**
* @brief Get whether the indicator of the slider is set or not.
*
* @param[in] obj The object.
*
* @return @c true if indicator is shown on focus, @c false otherwise
*
* @ingroup Elm_Slider
*/
EAPI Eina_Bool elm_slider_indicator_show_on_focus_get(const Evas_Object *obj);
/**
* @brief Set whether to enlarge slider indicator (augmented knob) or not.
*
* By default, indicator will be bigger while dragged by the user.
*
* @param[in] obj The object.
* @param[in] show @c true will make it enlarge, @c false will let the knob
* always at default size.
*
* @ingroup Elm_Slider
*/
EAPI void elm_slider_indicator_show_set(Evas_Object *obj, Eina_Bool show);
/**
* @brief Get whether a given slider widget's enlarging indicator or not.
*
* @param[in] obj The object.
*
* @return @c true will make it enlarge, @c false will let the knob always at
* default size.
*
* @ingroup Elm_Slider
*/
EAPI Eina_Bool elm_slider_indicator_show_get(const Evas_Object *obj);
#include "efl_ui_slider.eo.legacy.h"