Efl.Ui.Slider: add visible_mode() as an indicator part API
Ref T6376
This commit is contained in:
parent
67996afbf6
commit
651d9e94a0
|
@ -42,7 +42,8 @@ test_slider_interval(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void
|
||||||
|
|
||||||
efl_add(EFL_UI_SLIDER_INTERVAL_CLASS, bx,
|
efl_add(EFL_UI_SLIDER_INTERVAL_CLASS, bx,
|
||||||
efl_text_set(efl_added, "Horizontal"),
|
efl_text_set(efl_added, "Horizontal"),
|
||||||
efl_ui_slider_indicator_visible_mode_set(efl_added, EFL_UI_SLIDER_INDICATOR_VISIBLE_MODE_NONE),
|
efl_ui_slider_part_visible_mode_set(efl_part(efl_added, "indicator"),
|
||||||
|
EFL_UI_SLIDER_INDICATOR_VISIBLE_MODE_NONE),
|
||||||
efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(160, 0)),
|
efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(160, 0)),
|
||||||
efl_ui_format_string_set(efl_part(efl_added, "indicator"), "%1.5f"),
|
efl_ui_format_string_set(efl_part(efl_added, "indicator"), "%1.5f"),
|
||||||
efl_ui_slider_interval_value_set(efl_added, 0.4, 0.9),
|
efl_ui_slider_interval_value_set(efl_added, 0.4, 0.9),
|
||||||
|
@ -95,9 +96,22 @@ test_slider_interval(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void
|
||||||
elm_object_disabled_set(efl_added, EINA_TRUE),
|
elm_object_disabled_set(efl_added, EINA_TRUE),
|
||||||
efl_pack(hbx, efl_added));
|
efl_pack(hbx, efl_added));
|
||||||
|
|
||||||
|
efl_add(EFL_UI_SLIDER_INTERVAL_CLASS, hbx,
|
||||||
|
efl_text_set(efl_added, "Always Show Indicator:"),
|
||||||
|
efl_ui_slider_part_visible_mode_set(efl_part(efl_added, "indicator"),
|
||||||
|
EFL_UI_SLIDER_INDICATOR_VISIBLE_MODE_ALWAYS),
|
||||||
|
efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(0, 160)),
|
||||||
|
efl_ui_format_string_set(efl_added, "%1.0f units"),
|
||||||
|
efl_ui_format_string_set(efl_part(efl_added, "indicator"), "%1.0f"),
|
||||||
|
efl_ui_range_min_max_set(efl_added, 10, 145),
|
||||||
|
efl_ui_slider_step_set(efl_added, step),
|
||||||
|
efl_ui_direction_set(efl_added, EFL_UI_DIR_VERTICAL),
|
||||||
|
efl_pack(hbx, efl_added));
|
||||||
|
|
||||||
efl_add(EFL_UI_SLIDER_INTERVAL_CLASS, bx,
|
efl_add(EFL_UI_SLIDER_INTERVAL_CLASS, bx,
|
||||||
efl_text_set(efl_added, "Limited (100-500)"),
|
efl_text_set(efl_added, "Limited (100-500)"),
|
||||||
efl_ui_slider_indicator_visible_mode_set(efl_added, EFL_UI_SLIDER_INDICATOR_VISIBLE_MODE_ON_FOCUS),
|
efl_ui_slider_part_visible_mode_set(efl_part(efl_added, "indicator"),
|
||||||
|
EFL_UI_SLIDER_INDICATOR_VISIBLE_MODE_ON_FOCUS),
|
||||||
efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(260, 0)),
|
efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(260, 0)),
|
||||||
efl_ui_format_string_set(efl_added, "%1.0f units"),
|
efl_ui_format_string_set(efl_added, "%1.0f units"),
|
||||||
efl_ui_format_string_set(efl_part(efl_added, "indicator"), "%1.0f"),
|
efl_ui_format_string_set(efl_part(efl_added, "indicator"), "%1.0f"),
|
||||||
|
|
|
@ -1459,6 +1459,29 @@ _efl_ui_slider_part_efl_ui_format_format_string_get(Eo *obj, void *_pd EINA_UNUS
|
||||||
return sd->indi_template;
|
return sd->indi_template;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
EOLIAN static void
|
||||||
|
_efl_ui_slider_part_visible_mode_set(Eo *obj, void *_pd EINA_UNUSED, Efl_Ui_Slider_Indicator_Visible_Mode indicator_visible_mode)
|
||||||
|
{
|
||||||
|
Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
|
||||||
|
Efl_Ui_Slider_Data *sd = efl_data_scope_get(pd->obj, EFL_UI_SLIDER_CLASS);
|
||||||
|
|
||||||
|
if (!eina_streq(pd->part, "indicator")) return;
|
||||||
|
|
||||||
|
if (sd->indicator_visible_mode == indicator_visible_mode) return;
|
||||||
|
|
||||||
|
sd->indicator_visible_mode = indicator_visible_mode;
|
||||||
|
}
|
||||||
|
|
||||||
|
EOLIAN static Efl_Ui_Slider_Indicator_Visible_Mode
|
||||||
|
_efl_ui_slider_part_visible_mode_get(Eo *obj, void *_pd EINA_UNUSED)
|
||||||
|
{
|
||||||
|
Elm_Part_Data *pd = efl_data_scope_get(obj, EFL_UI_WIDGET_PART_CLASS);
|
||||||
|
Efl_Ui_Slider_Data *sd = efl_data_scope_get(pd->obj, EFL_UI_SLIDER_CLASS);
|
||||||
|
|
||||||
|
if (!eina_streq(pd->part, "indicator")) return EFL_UI_SLIDER_INDICATOR_VISIBLE_MODE_NONE;
|
||||||
|
return sd->indicator_visible_mode;
|
||||||
|
}
|
||||||
|
|
||||||
#include "efl_ui_slider_part.eo.c"
|
#include "efl_ui_slider_part.eo.c"
|
||||||
|
|
||||||
/* Efl.Part end */
|
/* Efl.Part end */
|
||||||
|
@ -1684,20 +1707,16 @@ elm_slider_indicator_format_function_set(Evas_Object *obj, slider_func_type func
|
||||||
EAPI void
|
EAPI void
|
||||||
elm_slider_indicator_show_on_focus_set(Evas_Object *obj, Eina_Bool flag)
|
elm_slider_indicator_show_on_focus_set(Evas_Object *obj, Eina_Bool flag)
|
||||||
{
|
{
|
||||||
EFL_UI_SLIDER_DATA_GET_OR_RETURN(obj, sd);
|
efl_ui_slider_part_visible_mode_set(efl_part(obj, "indicator"),
|
||||||
|
flag ? ELM_SLIDER_INDICATOR_VISIBLE_MODE_ON_FOCUS
|
||||||
if (flag)
|
: ELM_SLIDER_INDICATOR_VISIBLE_MODE_DEFAULT);
|
||||||
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
|
EAPI Eina_Bool
|
||||||
elm_slider_indicator_show_on_focus_get(const Evas_Object *obj)
|
elm_slider_indicator_show_on_focus_get(const Evas_Object *obj)
|
||||||
{
|
{
|
||||||
EFL_UI_SLIDER_DATA_GET_OR_RETURN(obj, sd, EINA_FALSE);
|
return (efl_ui_slider_part_visible_mode_get(efl_part(obj, "indicator"))
|
||||||
|
== EFL_UI_SLIDER_INDICATOR_VISIBLE_MODE_ON_FOCUS);
|
||||||
return (sd->indicator_visible_mode == ELM_SLIDER_INDICATOR_VISIBLE_MODE_ON_FOCUS);
|
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI void
|
EAPI void
|
||||||
|
@ -1737,18 +1756,13 @@ elm_slider_indicator_show_get(const Evas_Object *obj)
|
||||||
EAPI void
|
EAPI void
|
||||||
elm_slider_indicator_visible_mode_set(Evas_Object *obj, Elm_Slider_Indicator_Visible_Mode indicator_visible_mode)
|
elm_slider_indicator_visible_mode_set(Evas_Object *obj, Elm_Slider_Indicator_Visible_Mode indicator_visible_mode)
|
||||||
{
|
{
|
||||||
EFL_UI_SLIDER_DATA_GET_OR_RETURN(obj, sd);
|
efl_ui_slider_part_visible_mode_set(efl_part(obj, "indicator"), indicator_visible_mode);
|
||||||
|
|
||||||
if (sd->indicator_visible_mode == indicator_visible_mode) return;
|
|
||||||
sd->indicator_visible_mode = indicator_visible_mode;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI Elm_Slider_Indicator_Visible_Mode
|
EAPI Elm_Slider_Indicator_Visible_Mode
|
||||||
elm_slider_indicator_visible_mode_get(const Evas_Object *obj)
|
elm_slider_indicator_visible_mode_get(const Evas_Object *obj)
|
||||||
{
|
{
|
||||||
EFL_UI_SLIDER_DATA_GET_OR_RETURN(obj, sd, ELM_SLIDER_INDICATOR_VISIBLE_MODE_NONE);
|
return efl_ui_slider_part_visible_mode_get(efl_part(obj, "indicator"));
|
||||||
|
|
||||||
return sd->indicator_visible_mode;
|
|
||||||
}
|
}
|
||||||
|
|
||||||
/* Internal EO APIs and hidden overrides */
|
/* Internal EO APIs and hidden overrides */
|
||||||
|
|
|
@ -1,7 +1,18 @@
|
||||||
|
import efl_ui;
|
||||||
|
|
||||||
class Efl.Ui.Slider.Part (Efl.Ui.Layout.Part, Efl.Ui.Format)
|
class Efl.Ui.Slider.Part (Efl.Ui.Layout.Part, Efl.Ui.Format)
|
||||||
{
|
{
|
||||||
[[Elementary slider internal part class]]
|
[[Elementary slider internal part class]]
|
||||||
data: null;
|
data: null;
|
||||||
|
methods {
|
||||||
|
@property visible_mode {
|
||||||
|
[[Set/Get the visible mode of indicator.
|
||||||
|
]]
|
||||||
|
values {
|
||||||
|
indicator_visible_mode: Efl.Ui.Slider.Indicator_Visible_Mode; [[The indicator visible mode.]]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
implements {
|
implements {
|
||||||
Efl.Ui.Format.format_cb { set; }
|
Efl.Ui.Format.format_cb { set; }
|
||||||
Efl.Ui.Format.format_string { set; get; }
|
Efl.Ui.Format.format_string { set; get; }
|
||||||
|
|
Loading…
Reference in New Issue