summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorWoochan Lee <wc0917.lee@samsung.com>2018-05-20 03:58:41 +0900
committerJaehyun Cho <jae_hyun.cho@samsung.com>2018-05-20 03:58:41 +0900
commit428d74ebc1f6ea5dab5c46f3c885c8aa8fbe93e0 (patch)
treef5459a851e7aefbcddc8c9c25195d08e5767340d /src
parent976b9d877e762aee6e0fbd1b37766591644a2f2f (diff)
efl_ui_tags: Fixed bug when setting format string.
Summary: efl_ui_format_string_set was not working well. Changed default format text. ("++++ %d" text for test only.) @fix Reviewers: Jaehyun_Cho, cedric, woohyun Reviewed By: Jaehyun_Cho Subscribers: zmike, cedric Tags: #efl Differential Revision: https://phab.enlightenment.org/D6044
Diffstat (limited to 'src')
-rw-r--r--src/bin/elementary/test_ui_tags.c40
-rw-r--r--src/lib/elementary/efl_ui_tags.c6
-rw-r--r--src/lib/elementary/elm_config.c1
3 files changed, 34 insertions, 13 deletions
diff --git a/src/bin/elementary/test_ui_tags.c b/src/bin/elementary/test_ui_tags.c
index b7711bf2b4..15faebe4af 100644
--- a/src/bin/elementary/test_ui_tags.c
+++ b/src/bin/elementary/test_ui_tags.c
@@ -33,10 +33,22 @@ _item_deleted_cb(void *data, const Efl_Event *ev)
33 } 33 }
34} 34}
35 35
36static void
37_clicked(void *data, const Efl_Event *ev EINA_UNUSED)
38{
39 Eo *tags = data;
40
41 if (efl_ui_tags_expanded_get(tags))
42 efl_ui_tags_expanded_set(tags, EINA_FALSE);
43 else
44 efl_ui_tags_expanded_set(tags, EINA_TRUE);
45}
46
47
36void 48void
37test_ui_tags(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED) 49test_ui_tags(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
38{ 50{
39 Eo *win, *bx; 51 Eo *win, *layout, *tags;
40 52
41 const char* strs[] = { 53 const char* strs[] = {
42 "one", "two", "three", "four", "five", "six", "seven", "eight", "nine" 54 "one", "two", "three", "four", "five", "six", "seven", "eight", "nine"
@@ -44,26 +56,34 @@ test_ui_tags(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_i
44 56
45 Eina_Array *array; 57 Eina_Array *array;
46 unsigned int i; 58 unsigned int i;
59 char buf[PATH_MAX];
47 60
48 win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(), 61 win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
49 efl_ui_win_type_set(efl_added, EFL_UI_WIN_BASIC), 62 efl_ui_win_type_set(efl_added, EFL_UI_WIN_BASIC),
50 efl_text_set(efl_added, "Efl.Ui.Tags"), 63 efl_text_set(efl_added, "Efl.Ui.Tags"),
51 efl_ui_win_autodel_set(efl_added, EINA_TRUE)); 64 efl_ui_win_autodel_set(efl_added, EINA_TRUE));
52 65
66 snprintf(buf, sizeof(buf), "%s/objects/multibuttonentry.edj", elm_app_data_dir_get());
67 layout = efl_add(EFL_UI_LAYOUT_OBJECT_CLASS, win,
68 elm_layout_file_set(efl_added, buf, "multibuttonentry_test"),
69 elm_win_resize_object_add(win, efl_added));
70
53 array = eina_array_new(10); 71 array = eina_array_new(10);
54 for (i = 0; i < 9; i++) 72 for (i = 0; i < 9; i++)
55 eina_array_push(array, strs[i]); 73 eina_array_push(array, strs[i]);
56 74
57 bx = efl_add(EFL_UI_BOX_CLASS, win, 75 tags = efl_add(EFL_UI_TAGS_CLASS, layout,
58 efl_content_set(win, efl_added), 76 efl_ui_tags_items_set(efl_added, array),
59 efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN)); 77 efl_event_callback_add(efl_added, EFL_UI_TAGS_EVENT_ITEM_ADDED, _item_added_cb, array),
78 efl_event_callback_add(efl_added, EFL_UI_TAGS_EVENT_ITEM_DELETED, _item_deleted_cb, array),
79 efl_text_set(efl_added, "To :"),
80 efl_ui_format_string_set(efl_added, "+ %d items"),
81 elm_object_part_content_set(layout, "multibuttonentry", efl_added));
60 82
61 efl_add(EFL_UI_TAGS_CLASS, bx, 83 efl_add(EFL_UI_BUTTON_CLASS, layout,
62 efl_ui_tags_items_set(efl_added, array), 84 efl_text_set(efl_added, "Change mode"),
63 efl_event_callback_add(efl_added, EFL_UI_TAGS_EVENT_ITEM_ADDED, _item_added_cb, array), 85 efl_event_callback_add(efl_added, EFL_UI_EVENT_CLICKED, _clicked, tags),
64 efl_event_callback_add(efl_added, EFL_UI_TAGS_EVENT_ITEM_DELETED, _item_deleted_cb, array), 86 elm_object_part_content_set(layout, "box", efl_added));
65 efl_text_set(efl_added, "To :"),
66 efl_pack(bx, efl_added));
67 87
68 efl_gfx_entity_size_set(win, EINA_SIZE2D(320, 480)); 88 efl_gfx_entity_size_set(win, EINA_SIZE2D(320, 480));
69} 89}
diff --git a/src/lib/elementary/efl_ui_tags.c b/src/lib/elementary/efl_ui_tags.c
index 25b5b8f46e..2e237c3811 100644
--- a/src/lib/elementary/efl_ui_tags.c
+++ b/src/lib/elementary/efl_ui_tags.c
@@ -102,7 +102,7 @@ _shrink_mode_set(Eo *obj,
102 } 102 }
103 else 103 else
104 { 104 {
105 snprintf(buf, sizeof(buf), "+++++ %d", count); 105 snprintf(buf, sizeof(buf), "+ %d", count);
106 edje_object_part_text_escaped_set(sd->end, "efl.text", buf); 106 edje_object_part_text_escaped_set(sd->end, "efl.text", buf);
107 } 107 }
108 108
@@ -119,14 +119,14 @@ _shrink_mode_set(Eo *obj,
119 if (sd->format_cb) 119 if (sd->format_cb)
120 { 120 {
121 eina_strbuf_reset(sd->format_strbuf); 121 eina_strbuf_reset(sd->format_strbuf);
122
123 eina_value_set(&val, count); 122 eina_value_set(&val, count);
123 sd->format_cb(sd->format_cb_data, sd->format_strbuf, val);
124 edje_object_part_text_escaped_set(sd->end, "efl.text", 124 edje_object_part_text_escaped_set(sd->end, "efl.text",
125 eina_strbuf_string_get(sd->format_strbuf)); 125 eina_strbuf_string_get(sd->format_strbuf));
126 } 126 }
127 else 127 else
128 { 128 {
129 snprintf(buf, sizeof(buf), "+++++ %d", count); 129 snprintf(buf, sizeof(buf), "+ %d", count);
130 edje_object_part_text_escaped_set(sd->end, "efl.text", buf); 130 edje_object_part_text_escaped_set(sd->end, "efl.text", buf);
131 } 131 }
132 132
diff --git a/src/lib/elementary/elm_config.c b/src/lib/elementary/elm_config.c
index aa76258e04..27afd8a652 100644
--- a/src/lib/elementary/elm_config.c
+++ b/src/lib/elementary/elm_config.c
@@ -176,6 +176,7 @@ static const Elm_Color_Class _elm_color_classes[] = {
176 {"datetime_text", "Datetime Text"}, 176 {"datetime_text", "Datetime Text"},
177 {"multibuttonentry_label", "Multibuttonentry Text"}, 177 {"multibuttonentry_label", "Multibuttonentry Text"},
178 {"tags_label", "Tags Text"}, 178 {"tags_label", "Tags Text"},
179 {"tags_number", "Tags Number Text"},
179 {"spinner", "Spinner Text"}, 180 {"spinner", "Spinner Text"},
180 {"spinner_disabled", "Spinner Disabled Text"}, 181 {"spinner_disabled", "Spinner Disabled Text"},
181 {NULL, NULL} 182 {NULL, NULL}