summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--data/elementary/themes/edc/efl/tags.edc30
-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
4 files changed, 43 insertions, 34 deletions
diff --git a/data/elementary/themes/edc/efl/tags.edc b/data/elementary/themes/edc/efl/tags.edc
index 82f861a05d..9c9b7352d8 100644
--- a/data/elementary/themes/edc/efl/tags.edc
+++ b/data/elementary/themes/edc/efl/tags.edc
@@ -289,34 +289,22 @@ group { "efl/tags/btn";
289} 289}
290 290
291group { "efl/tags/number"; 291group { "efl/tags/number";
292 styles {
293 style { name: "textblock_style_efl_tags_default";
294 base: "font="FNBD" font_size=10 text_class=tags_closed style=glow color=#3399ffff glow_color=#3399ff18 align=center glow2_color=#3399ff12 wrap=char";
295 tag: "br" "\n";
296 tag: "ps" "ps";
297 tag: "hilight" "+ font="FNBD;
298 tag: "b" "+ font="FNBD;
299 tag: "tab" "\t";
300 }
301 }
302 parts { 292 parts {
303 rect { "bg"; 293 text { "efl.text";
304 desc { "default";
305 color: 0 0 0 0;
306 }
307 }
308 textblock { "efl.text";
309 nomouse; 294 nomouse;
295 effect: GLOW;
310 scale; 296 scale;
311 desc { "default"; 297 desc { "default";
312 rel1.offset: 2 2; 298 color: FN_COL_HIGHLIGHT;
313 rel1.to: "bg"; 299 color_class: "tags_number";
314 rel2.offset: -3 -3; 300 text { font: FNBD; size: 10;
315 rel2.to: "bg";
316 text { style: "textblock_style_tags_default";
317 min: 1 1; 301 min: 1 1;
318 ellipsis: -1; 302 ellipsis: -1;
303 align: 0.5 0.5;
304 text_class: "tags_number";
319 } 305 }
306 rel1.offset: 2 2;
307 rel2.offset: -5 -5;
320 } 308 }
321 } 309 }
322 } 310 }
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}