aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/elementary/test_ui_slider.c
diff options
context:
space:
mode:
authorHosang Kim <hosang12.kim@samsung.com>2018-05-15 14:16:00 +0900
committerJaehyun Cho <jae_hyun.cho@samsung.com>2018-05-15 14:16:00 +0900
commit5db61e4d64f684a8eaf4b75ebceb18d8708ac8d5 (patch)
tree923f851151ef84ae0e12b8952ec09e5852bd1bfa /src/bin/elementary/test_ui_slider.c
parentelm: use build dir data when EFL_RUN_IN_TREE is set (diff)
downloadefl-5db61e4d64f684a8eaf4b75ebceb18d8708ac8d5.tar.gz
efl_ui_slider: refactor slider widget.
Test Plan: elementary_test -> Efl.Ui.Slider, Efl.Ui.Slider_Interval, slider Reviewers: woohyun, cedric, Jaehyun_Cho Reviewed By: Jaehyun_Cho Subscribers: zmike, cedric Tags: #efl Differential Revision: https://phab.enlightenment.org/D5908
Diffstat (limited to 'src/bin/elementary/test_ui_slider.c')
-rw-r--r--src/bin/elementary/test_ui_slider.c72
1 files changed, 39 insertions, 33 deletions
diff --git a/src/bin/elementary/test_ui_slider.c b/src/bin/elementary/test_ui_slider.c
index 3433a1d899..966cc6e86b 100644
--- a/src/bin/elementary/test_ui_slider.c
+++ b/src/bin/elementary/test_ui_slider.c
@@ -29,9 +29,8 @@ _slider_changed_cb(void *data EINA_UNUSED, const Efl_Event *ev)
void
test_ui_slider(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
{
- Eo *win, *bx, *hbx, *ic;
+ Eo *win, *bx, *hbx;
double step;
- char buf[PATH_MAX];
win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
efl_ui_win_type_set(efl_added, EFL_UI_WIN_BASIC),
@@ -41,47 +40,62 @@ test_ui_slider(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
bx = efl_add(EFL_UI_BOX_CLASS, win,
efl_content_set(win, efl_added));
- snprintf(buf, sizeof(buf), "%s/images/logo_small.png", elm_app_data_dir_get());
- ic = efl_add(EFL_UI_IMAGE_CLASS, win,
- efl_file_set(efl_added, buf, NULL));
+ efl_add(EFL_UI_TEXT_CLASS, bx,
+ efl_text_set(efl_added, "Horizontal"),
+ efl_text_interactive_editable_set(efl_added, EINA_FALSE),
+ efl_pack(bx, efl_added));
efl_add(EFL_UI_SLIDER_CLASS, bx,
- efl_text_set(efl_added, "Horizontal"),
- efl_content_set(efl_added, ic),
- efl_ui_slider_part_indicator_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_ui_format_string_set(efl_part(efl_added, "indicator"), "%1.5f"),
+ efl_gfx_size_hint_weight_set(efl_added, EVAS_HINT_EXPAND, 0.0),
+ efl_pack(bx, efl_added));
+
+ efl_add(EFL_UI_TEXT_CLASS, bx,
+ efl_text_set(efl_added, "Horizontal Inverted"),
+ efl_text_interactive_editable_set(efl_added, EINA_FALSE),
efl_pack(bx, efl_added));
- step = _step_size_calculate(0, 9);
efl_add(EFL_UI_SLIDER_CLASS, bx,
+ efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(160, 0)),
+ efl_gfx_size_hint_weight_set(efl_added, EVAS_HINT_EXPAND, 0.0),
+ efl_ui_direction_set(efl_added, EFL_UI_DIR_LEFT),
+ efl_pack(bx, efl_added));
+
+ efl_add(EFL_UI_TEXT_CLASS, bx,
efl_text_set(efl_added, "Manual step"),
+ efl_text_interactive_editable_set(efl_added, EINA_FALSE),
+ efl_pack(bx, efl_added));
+
+ step = _step_size_calculate(0, 9);
+ efl_add(EFL_UI_SLIDER_CLASS, bx,
efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(120, 0)),
- efl_ui_format_string_set(efl_added, "%1.1f units"),
- efl_ui_format_string_set(efl_part(efl_added, "indicator"), "%1.1f"),
+ efl_gfx_size_hint_align_set(efl_added, 0.5, 0.5),
efl_ui_range_step_set(efl_added, step),
efl_pack(bx, efl_added));
- efl_add(EFL_UI_SLIDER_CLASS, bx,
+ efl_add(EFL_UI_TEXT_CLASS, bx,
efl_text_set(efl_added, "Disabled"),
+ efl_text_interactive_editable_set(efl_added, EINA_FALSE),
+ efl_pack(bx, efl_added));
+
+ efl_add(EFL_UI_SLIDER_CLASS, bx,
efl_gfx_size_hint_min_set(efl_added, EINA_SIZE2D(120, 0)),
- 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_range_step_set(efl_added, step),
elm_object_disabled_set(efl_added, EINA_TRUE),
efl_pack(bx, efl_added));
+ efl_add(EFL_UI_TEXT_CLASS, bx,
+ efl_text_set(efl_added, "Vertical"),
+ efl_text_interactive_editable_set(efl_added, EINA_FALSE),
+ efl_pack(bx, efl_added));
+
hbx = efl_add(EFL_UI_BOX_CLASS, bx,
efl_ui_direction_set(efl_added, EFL_UI_DIR_HORIZONTAL),
efl_pack(bx, efl_added));
efl_add(EFL_UI_SLIDER_CLASS, hbx,
- efl_text_set(efl_added, "Vertical"),
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_range_step_set(efl_added, step),
efl_ui_range_value_set(efl_added, 70),
@@ -89,10 +103,7 @@ test_ui_slider(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
efl_pack(hbx, efl_added));
efl_add(EFL_UI_SLIDER_CLASS, hbx,
- efl_text_set(efl_added, "Disabled"),
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_range_step_set(efl_added, step),
efl_ui_direction_set(efl_added, EFL_UI_DIR_VERTICAL),
@@ -100,25 +111,20 @@ test_ui_slider(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event
efl_pack(hbx, efl_added));
efl_add(EFL_UI_SLIDER_CLASS, hbx,
- efl_text_set(efl_added, "Always Show Indicator:"),
- efl_ui_slider_part_indicator_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_range_value_set(efl_added, 35),
efl_ui_range_step_set(efl_added, step),
- efl_ui_direction_set(efl_added, EFL_UI_DIR_VERTICAL),
+ efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN),
efl_pack(hbx, efl_added));
+ efl_add(EFL_UI_TEXT_CLASS, bx,
+ efl_text_set(efl_added, "Limit"),
+ efl_text_interactive_editable_set(efl_added, EINA_FALSE),
+ efl_pack(bx, efl_added));
+
efl_add(EFL_UI_SLIDER_CLASS, bx,
- efl_text_set(efl_added, "Limited (0-100)"),
- efl_ui_slider_part_indicator_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_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, 0, 150),
efl_ui_range_step_set(efl_added, step),
efl_event_callback_add(efl_added, EFL_UI_SLIDER_EVENT_CHANGED, _slider_changed_cb, NULL),