forked from enlightenment/efl
Introduce Efl.Ui.Tags(changed from elm_multibuttonentry)
Summary: https://phab.enlightenment.org/T5358 Create new concept of adding items and rename widget to tags. Reviewers: Jaehyun_Cho Reviewed By: Jaehyun_Cho Subscribers: cedric Differential Revision: https://phab.enlightenment.org/D6008
This commit is contained in:
parent
fe94d2c106
commit
8c6ae23c86
|
@ -1024,6 +1024,7 @@ elementary/themes/edc/efl/focus.edc \
|
||||||
elementary/themes/edc/efl/frame.edc \
|
elementary/themes/edc/efl/frame.edc \
|
||||||
elementary/themes/edc/efl/navigation_bar.edc \
|
elementary/themes/edc/efl/navigation_bar.edc \
|
||||||
elementary/themes/edc/efl/navigation_layout.edc \
|
elementary/themes/edc/efl/navigation_layout.edc \
|
||||||
|
elementary/themes/edc/efl/tags.edc \
|
||||||
elementary/themes/edc/efl/nstate.edc \
|
elementary/themes/edc/efl/nstate.edc \
|
||||||
elementary/themes/edc/efl/panes.edc \
|
elementary/themes/edc/efl/panes.edc \
|
||||||
elementary/themes/edc/efl/photocam.edc \
|
elementary/themes/edc/efl/photocam.edc \
|
||||||
|
|
|
@ -394,6 +394,30 @@ color_classes {
|
||||||
color: FN_COL_DISABLE;
|
color: FN_COL_DISABLE;
|
||||||
desc: "Text of a disabled multibuttonentry item";
|
desc: "Text of a disabled multibuttonentry item";
|
||||||
}
|
}
|
||||||
|
color_class { name: "tags_bg";
|
||||||
|
color: 0 0 0 0;
|
||||||
|
desc: "Background of a tags widget";
|
||||||
|
}
|
||||||
|
color_class { name: "tags_item_bg";
|
||||||
|
color: 0 0 0 0;
|
||||||
|
desc: "Background of a tags item object";
|
||||||
|
}
|
||||||
|
color_class { name: "tags_item_bg_selected";
|
||||||
|
color: 0 0 0 0;
|
||||||
|
desc: "Background of a selected tags item object";
|
||||||
|
}
|
||||||
|
color_class { name: "tags_item_text";
|
||||||
|
color: FN_COL_DEFAULT;
|
||||||
|
desc: "Text of a tags item";
|
||||||
|
}
|
||||||
|
color_class { name: "tags_item_text_pressed";
|
||||||
|
color: FN_COL_HIGHLIGHT;
|
||||||
|
desc: "Text of a pressed tags item";
|
||||||
|
}
|
||||||
|
color_class { name: "tags_item_text_disabled";
|
||||||
|
color: FN_COL_DISABLE;
|
||||||
|
desc: "Text of a disabled tags item";
|
||||||
|
}
|
||||||
color_class { "elm/win/background";
|
color_class { "elm/win/background";
|
||||||
color: 64 64 64 255;
|
color: 64 64 64 255;
|
||||||
desc: "Background color of a standard window";
|
desc: "Background color of a standard window";
|
||||||
|
|
|
@ -184,6 +184,7 @@ collections {
|
||||||
#include "edc/efl/popup.edc"
|
#include "edc/efl/popup.edc"
|
||||||
#include "edc/efl/video.edc"
|
#include "edc/efl/video.edc"
|
||||||
#include "edc/efl/focus.edc"
|
#include "edc/efl/focus.edc"
|
||||||
|
#include "edc/efl/tags.edc"
|
||||||
#include "edc/efl/tooltip.edc"
|
#include "edc/efl/tooltip.edc"
|
||||||
#include "edc/efl/photocam.edc"
|
#include "edc/efl/photocam.edc"
|
||||||
#include "edc/efl/progress.edc"
|
#include "edc/efl/progress.edc"
|
||||||
|
|
|
@ -0,0 +1,323 @@
|
||||||
|
group { "efl/tags";
|
||||||
|
data.item: "horizontal_pad" 0;
|
||||||
|
data.item: "vertical_pad" 0;
|
||||||
|
data.item: "closed_height" 0;
|
||||||
|
parts {
|
||||||
|
rect { "bg";
|
||||||
|
scale;
|
||||||
|
desc { "default";
|
||||||
|
color_class: "tags_bg";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
swallow { "efl.swallow.background";
|
||||||
|
scale;
|
||||||
|
desc { "default";
|
||||||
|
rel.to: "bg";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
swallow { "box.swallow";
|
||||||
|
desc { "default";
|
||||||
|
rel.to: "bg";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
group { "efl/tags/label";
|
||||||
|
parts {
|
||||||
|
text { "efl.text";
|
||||||
|
nomouse;
|
||||||
|
effect: GLOW;
|
||||||
|
scale;
|
||||||
|
desc { "default";
|
||||||
|
color: FN_COL_HIGHLIGHT;
|
||||||
|
color_class: "tags_label";
|
||||||
|
text { font: FNBD; size: 10;
|
||||||
|
min: 1 1;
|
||||||
|
ellipsis: -1;
|
||||||
|
align: 0.5 0.5;
|
||||||
|
text_class: "tags_label";
|
||||||
|
}
|
||||||
|
rel1.offset: 2 2;
|
||||||
|
rel2.offset: -5 -5;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
group { "efl/tags/btn";
|
||||||
|
images.image: "button_normal.png" COMP;
|
||||||
|
images.image: "button_clicked.png" COMP;
|
||||||
|
images.image: "sym_close_dark_normal.png" COMP;
|
||||||
|
images.image: "sym_close_dark_selected.png" COMP;
|
||||||
|
images.image: "win_glow.png" COMP;
|
||||||
|
styles {
|
||||||
|
style { name: "efl_tags_textblock_style";
|
||||||
|
base: "font="FN" align=0.5 font_size=10 color=#ffffffff style=shadow,bottom shadow_color=#00000080 text_class=tags_item ellipsis=1.0";
|
||||||
|
tag: "br" "\n";
|
||||||
|
tag: "ps" "ps";
|
||||||
|
tag: "hilight" "+ font="FNBD;
|
||||||
|
tag: "b" "+ font="FNBD;
|
||||||
|
tag: "tab" "\t";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
script {
|
||||||
|
public disabled = 0;
|
||||||
|
}
|
||||||
|
|
||||||
|
parts {
|
||||||
|
rect { "bg";
|
||||||
|
desc { "default";
|
||||||
|
color_class: "tags_item_bg";
|
||||||
|
}
|
||||||
|
desc { "pressed";
|
||||||
|
color_class: "tags_item_bg_selected";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
image { "base";
|
||||||
|
desc { "default";
|
||||||
|
image.normal: "button_normal.png";
|
||||||
|
image.border: 4 4 3 5;
|
||||||
|
image.middle: SOLID;
|
||||||
|
rel1.offset: -1 0;
|
||||||
|
rel2.offset: 0 1;
|
||||||
|
fill.smooth: 0;
|
||||||
|
}
|
||||||
|
desc { "pressed";
|
||||||
|
inherit: "default";
|
||||||
|
image.normal: "button_clicked.png";
|
||||||
|
image.border: 5 5 4 6;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
image { "glow";
|
||||||
|
nomouse;
|
||||||
|
desc { "default";
|
||||||
|
image.normal: "win_glow.png";
|
||||||
|
image.border: 9 9 9 9;
|
||||||
|
image.middle: 0;
|
||||||
|
rel1.offset: -2 -3;
|
||||||
|
rel1.to: "base";
|
||||||
|
rel2.offset: 1 0;
|
||||||
|
rel2.to: "base";
|
||||||
|
fill.smooth: 0;
|
||||||
|
color: 255 255 255 0;
|
||||||
|
hid;
|
||||||
|
}
|
||||||
|
desc { "focused";
|
||||||
|
inherit: "default";
|
||||||
|
color: 255 255 255 255;
|
||||||
|
vis;
|
||||||
|
}
|
||||||
|
desc { "unfocused";
|
||||||
|
inherit: "default";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
image { "close";
|
||||||
|
nomouse;
|
||||||
|
desc { "default";
|
||||||
|
image.normal: "sym_close_dark_normal.png";
|
||||||
|
rel1.to: "del";
|
||||||
|
rel2.to: "del";
|
||||||
|
min: 15 15;
|
||||||
|
max: 15 15;
|
||||||
|
fixed: 1 1;
|
||||||
|
}
|
||||||
|
desc { "clicked";
|
||||||
|
inherit: "default";
|
||||||
|
image.normal: "sym_close_dark_selected.png";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
rect { "del";
|
||||||
|
scale;
|
||||||
|
desc { "default";
|
||||||
|
fixed: 1 0;
|
||||||
|
min: 4 4;
|
||||||
|
align: 1.0 0.5;
|
||||||
|
aspect: 1.0 1.0; aspect_preference: VERTICAL;
|
||||||
|
rel1.relative: 1.0 0.0;
|
||||||
|
rel1.to: "base";
|
||||||
|
rel1.offset: -6 5;
|
||||||
|
rel2.offset: -6 -7;
|
||||||
|
rel2.to: "base";
|
||||||
|
color: 0 0 0 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
textblock { "efl.btn.text";
|
||||||
|
nomouse;
|
||||||
|
scale;
|
||||||
|
desc { "default";
|
||||||
|
color_class: "tags_item_text";
|
||||||
|
text { style: "efl_tags_textblock_style";
|
||||||
|
min: 1 1;
|
||||||
|
ellipsis: -1;
|
||||||
|
text_class: "tags_item_text";
|
||||||
|
}
|
||||||
|
hid;
|
||||||
|
rel1.offset: 5 5;
|
||||||
|
rel1.to: "base";
|
||||||
|
rel2.to_x: "del";
|
||||||
|
rel2.to_y: "base";
|
||||||
|
rel2.relative: 0.0 1.0;
|
||||||
|
rel2.offset: -3 -7;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
textblock { "text";
|
||||||
|
nomouse;
|
||||||
|
scale;
|
||||||
|
desc { "default";
|
||||||
|
color_class: "tags_item_text";
|
||||||
|
text { style: "efl_tags_textblock_style";
|
||||||
|
text_source: "efl.btn.text";
|
||||||
|
min: 0 1;
|
||||||
|
align: 0.0 0.5;
|
||||||
|
text_class: "tags_item_text";
|
||||||
|
}
|
||||||
|
align: 0.0 0.5;
|
||||||
|
rel1.offset: 5 5;
|
||||||
|
rel1.to: "base";
|
||||||
|
rel2.to_x: "del";
|
||||||
|
rel2.to_y: "base";
|
||||||
|
rel2.relative: 0.0 1.0;
|
||||||
|
rel2.offset: -3 -7;
|
||||||
|
}
|
||||||
|
desc { "pressed";
|
||||||
|
inherit: "default";
|
||||||
|
color_class: "tags_item_text_pressed";
|
||||||
|
text {
|
||||||
|
text_class: "tags_item_text_pressed";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
desc { "disabled";
|
||||||
|
inherit: "default";
|
||||||
|
color_class: "tags_item_text_disabled";
|
||||||
|
text {
|
||||||
|
text_class: "tags_item_text_disabled";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
programs {
|
||||||
|
program {
|
||||||
|
signal: "mouse,clicked,1";
|
||||||
|
source: "base";
|
||||||
|
script {
|
||||||
|
if (get_int(disabled) == 0) {
|
||||||
|
emit("clicked", "");
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
program {
|
||||||
|
signal: "efl,state,default";
|
||||||
|
source: "efl";
|
||||||
|
action: STATE_SET "default";
|
||||||
|
target: "glow";
|
||||||
|
}
|
||||||
|
program {
|
||||||
|
signal: "efl,state,focused";
|
||||||
|
source: "efl";
|
||||||
|
action: STATE_SET "focused";
|
||||||
|
target: "glow";
|
||||||
|
}
|
||||||
|
program {
|
||||||
|
signal: "efl,state,enabled";
|
||||||
|
source: "efl";
|
||||||
|
script {
|
||||||
|
set_state(PART:"text", "default", 0.0);
|
||||||
|
set_int(disabled , 0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
program {
|
||||||
|
signal: "efl,state,disabled";
|
||||||
|
source: "efl";
|
||||||
|
script {
|
||||||
|
new st[31];
|
||||||
|
new Float: vl;
|
||||||
|
get_state(PART:"glow", st, 30, vl);
|
||||||
|
if (!strcmp(st, "focused"))
|
||||||
|
set_state(PART:"glow", "default", 0.0);
|
||||||
|
set_state(PART:"text", "disabled", 0.0);
|
||||||
|
set_int(disabled , 1);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
program {
|
||||||
|
signal: "efl,state,unfocused";
|
||||||
|
source: "efl";
|
||||||
|
action: STATE_SET "unfocused";
|
||||||
|
target: "glow";
|
||||||
|
}
|
||||||
|
program {
|
||||||
|
signal: "mouse,down,1";
|
||||||
|
source: "base";
|
||||||
|
script {
|
||||||
|
if (get_int(disabled) == 0) {
|
||||||
|
set_state(PART:"base", "pressed", 0.0);
|
||||||
|
set_state(PART:"bg", "pressed", 0.0);
|
||||||
|
set_state(PART:"text", "pressed", 0.0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
program {
|
||||||
|
signal: "mouse,up,1";
|
||||||
|
source: "base";
|
||||||
|
script {
|
||||||
|
if (get_int(disabled) == 0) {
|
||||||
|
set_state(PART:"base", "default", 0.0);
|
||||||
|
set_state(PART:"bg", "default", 0.0);
|
||||||
|
set_state(PART:"text", "default", 0.0);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
program {
|
||||||
|
signal: "mouse,clicked,1";
|
||||||
|
source: "del";
|
||||||
|
action: SIGNAL_EMIT "efl,deleted" "efl";
|
||||||
|
}
|
||||||
|
program {
|
||||||
|
signal: "mouse,down,1";
|
||||||
|
source: "del";
|
||||||
|
action: STATE_SET "clicked";
|
||||||
|
target: "close";
|
||||||
|
}
|
||||||
|
program {
|
||||||
|
signal: "mouse,up,1";
|
||||||
|
source: "del";
|
||||||
|
action: STATE_SET "default";
|
||||||
|
target: "close";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
group { "efl/tags/number";
|
||||||
|
styles {
|
||||||
|
style { name: "textblock_style_efl_tags_default";
|
||||||
|
base: "font="FNBD" font_size=10 text_class=tags_closed style=glow color=#3399ffff glow_color=#3399ff18 align=center glow2_color=#3399ff12 wrap=char";
|
||||||
|
tag: "br" "\n";
|
||||||
|
tag: "ps" "ps";
|
||||||
|
tag: "hilight" "+ font="FNBD;
|
||||||
|
tag: "b" "+ font="FNBD;
|
||||||
|
tag: "tab" "\t";
|
||||||
|
}
|
||||||
|
}
|
||||||
|
parts {
|
||||||
|
rect { "bg";
|
||||||
|
desc { "default";
|
||||||
|
color: 0 0 0 0;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
textblock { "efl.text";
|
||||||
|
nomouse;
|
||||||
|
scale;
|
||||||
|
desc { "default";
|
||||||
|
rel1.offset: 2 2;
|
||||||
|
rel1.to: "bg";
|
||||||
|
rel2.offset: -3 -3;
|
||||||
|
rel2.to: "bg";
|
||||||
|
text { style: "textblock_style_tags_default";
|
||||||
|
min: 1 1;
|
||||||
|
ellipsis: -1;
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
|
@ -29,6 +29,7 @@ elm_public_eolian_files = \
|
||||||
lib/elementary/efl_ui_spin_button.eo \
|
lib/elementary/efl_ui_spin_button.eo \
|
||||||
lib/elementary/efl_ui_datepicker.eo \
|
lib/elementary/efl_ui_datepicker.eo \
|
||||||
lib/elementary/efl_ui_timepicker.eo \
|
lib/elementary/efl_ui_timepicker.eo \
|
||||||
|
lib/elementary/efl_ui_tags.eo \
|
||||||
lib/elementary/efl_ui_video.eo \
|
lib/elementary/efl_ui_video.eo \
|
||||||
lib/elementary/efl_ui_win.eo \
|
lib/elementary/efl_ui_win.eo \
|
||||||
lib/elementary/efl_ui_win_inlined.eo \
|
lib/elementary/efl_ui_win_inlined.eo \
|
||||||
|
@ -395,6 +396,7 @@ includesunstable_HEADERS = \
|
||||||
lib/elementary/efl_ui_spin_button_private.h \
|
lib/elementary/efl_ui_spin_button_private.h \
|
||||||
lib/elementary/efl_ui_datepicker_private.h \
|
lib/elementary/efl_ui_datepicker_private.h \
|
||||||
lib/elementary/efl_ui_timepicker_private.h \
|
lib/elementary/efl_ui_timepicker_private.h \
|
||||||
|
lib/elementary/efl_ui_tags_private.h \
|
||||||
lib/elementary/elm_widget_table.h \
|
lib/elementary/elm_widget_table.h \
|
||||||
lib/elementary/elm_widget_thumb.h \
|
lib/elementary/elm_widget_thumb.h \
|
||||||
lib/elementary/elm_widget_toolbar.h \
|
lib/elementary/elm_widget_toolbar.h \
|
||||||
|
@ -759,6 +761,7 @@ lib_elementary_libelementary_la_SOURCES = \
|
||||||
lib/elementary/efl_ui_spin_button.c \
|
lib/elementary/efl_ui_spin_button.c \
|
||||||
lib/elementary/efl_ui_datepicker.c \
|
lib/elementary/efl_ui_datepicker.c \
|
||||||
lib/elementary/efl_ui_timepicker.c \
|
lib/elementary/efl_ui_timepicker.c \
|
||||||
|
lib/elementary/efl_ui_tags.c \
|
||||||
lib/elementary/elm_slideshow.c \
|
lib/elementary/elm_slideshow.c \
|
||||||
lib/elementary/elm_spinner.c \
|
lib/elementary/elm_spinner.c \
|
||||||
lib/elementary/elm_store.c \
|
lib/elementary/elm_store.c \
|
||||||
|
@ -1027,6 +1030,7 @@ bin/elementary/test_ui_spin.c \
|
||||||
bin/elementary/test_ui_spin_button.c \
|
bin/elementary/test_ui_spin_button.c \
|
||||||
bin/elementary/test_ui_datepicker.c \
|
bin/elementary/test_ui_datepicker.c \
|
||||||
bin/elementary/test_ui_timepicker.c \
|
bin/elementary/test_ui_timepicker.c \
|
||||||
|
bin/elementary/test_ui_tags.c \
|
||||||
bin/elementary/test_slideshow.c \
|
bin/elementary/test_slideshow.c \
|
||||||
bin/elementary/test_spinner.c \
|
bin/elementary/test_spinner.c \
|
||||||
bin/elementary/test_store.c \
|
bin/elementary/test_store.c \
|
||||||
|
|
|
@ -135,6 +135,7 @@ test_ui_spinner.c \
|
||||||
test_ui_buttonspin.c \
|
test_ui_buttonspin.c \
|
||||||
test_ui_datepicker.c \
|
test_ui_datepicker.c \
|
||||||
test_ui_timepicker.c \
|
test_ui_timepicker.c \
|
||||||
|
test_ui_tags.c \
|
||||||
test_store.c \
|
test_store.c \
|
||||||
test_sys_notify.c \
|
test_sys_notify.c \
|
||||||
test_systray.c \
|
test_systray.c \
|
||||||
|
|
|
@ -185,6 +185,7 @@ void test_ui_spin(void *data, Evas_Object *obj, void *event_info);
|
||||||
void test_ui_spin_button(void *data, Evas_Object *obj, void *event_info);
|
void test_ui_spin_button(void *data, Evas_Object *obj, void *event_info);
|
||||||
void test_ui_datepicker(void *data, Evas_Object *obj, void *event_info);
|
void test_ui_datepicker(void *data, Evas_Object *obj, void *event_info);
|
||||||
void test_ui_timepicker(void *data, Evas_Object *obj, void *event_info);
|
void test_ui_timepicker(void *data, Evas_Object *obj, void *event_info);
|
||||||
|
void test_ui_tags(void *data, Evas_Object *obj, void *event_info);
|
||||||
void test_index(void *data, Evas_Object *obj, void *event_info);
|
void test_index(void *data, Evas_Object *obj, void *event_info);
|
||||||
void test_index2(void *data, Evas_Object *obj, void *event_info);
|
void test_index2(void *data, Evas_Object *obj, void *event_info);
|
||||||
void test_index3(void *data, Evas_Object *obj, void *event_info);
|
void test_index3(void *data, Evas_Object *obj, void *event_info);
|
||||||
|
@ -841,6 +842,7 @@ add_tests:
|
||||||
ADD_TEST_EO(NULL, "Entries", "Efl.Ui.Text Label", test_efl_ui_text_label);
|
ADD_TEST_EO(NULL, "Entries", "Efl.Ui.Text Label", test_efl_ui_text_label);
|
||||||
ADD_TEST_EO(NULL, "Entries", "Efl.Ui.Text.Async", test_efl_ui_text_async);
|
ADD_TEST_EO(NULL, "Entries", "Efl.Ui.Text.Async", test_efl_ui_text_async);
|
||||||
ADD_TEST_EO(NULL, "Entries", "Ui.Text Item Factory", test_ui_text_item_factory);
|
ADD_TEST_EO(NULL, "Entries", "Ui.Text Item Factory", test_ui_text_item_factory);
|
||||||
|
ADD_TEST_EO(NULL, "Entries", "Efl.Ui.Tags", test_ui_tags);
|
||||||
|
|
||||||
//------------------------------//
|
//------------------------------//
|
||||||
ADD_TEST(NULL, "Advanced Entries", "Code Syntax", test_code_syntax);
|
ADD_TEST(NULL, "Advanced Entries", "Code Syntax", test_code_syntax);
|
||||||
|
|
|
@ -0,0 +1,69 @@
|
||||||
|
#ifdef HAVE_CONFIG_H
|
||||||
|
# include "elementary_config.h"
|
||||||
|
#endif
|
||||||
|
#include <Elementary.h>
|
||||||
|
|
||||||
|
static void
|
||||||
|
_item_added_cb(void *data, const Efl_Event *ev)
|
||||||
|
{
|
||||||
|
Eina_Array *array = data;
|
||||||
|
const char *str = ev->info;
|
||||||
|
|
||||||
|
printf("item added %s\n", str);
|
||||||
|
eina_array_push(array, str);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_item_deleted_cb(void *data, const Efl_Event *ev)
|
||||||
|
{
|
||||||
|
Eina_Array_Iterator iterator;
|
||||||
|
const char *item;
|
||||||
|
unsigned int i;
|
||||||
|
Eina_Array *array = data;
|
||||||
|
const char *str = ev->info;
|
||||||
|
|
||||||
|
printf("item deleted %s\n", str);
|
||||||
|
eina_array_clean(array);
|
||||||
|
|
||||||
|
const Eina_Array *tags_array = efl_ui_tags_items_get(ev->object);
|
||||||
|
EINA_ARRAY_ITER_NEXT(tags_array, i, item, iterator)
|
||||||
|
{
|
||||||
|
eina_array_push(array, item);
|
||||||
|
printf("item #%u: %s\n", i, item);
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
|
void
|
||||||
|
test_ui_tags(void *data EINA_UNUSED, Evas_Object *obj EINA_UNUSED, void *event_info EINA_UNUSED)
|
||||||
|
{
|
||||||
|
Eo *win, *bx;
|
||||||
|
|
||||||
|
const char* strs[] = {
|
||||||
|
"one", "two", "three", "four", "five", "six", "seven", "eight", "nine"
|
||||||
|
};
|
||||||
|
|
||||||
|
Eina_Array *array;
|
||||||
|
unsigned int i;
|
||||||
|
|
||||||
|
win = efl_add(EFL_UI_WIN_CLASS, efl_main_loop_get(),
|
||||||
|
efl_ui_win_type_set(efl_added, EFL_UI_WIN_BASIC),
|
||||||
|
efl_text_set(efl_added, "Efl.Ui.Tags"),
|
||||||
|
efl_ui_win_autodel_set(efl_added, EINA_TRUE));
|
||||||
|
|
||||||
|
array = eina_array_new(10);
|
||||||
|
for (i = 0; i < 9; i++)
|
||||||
|
eina_array_push(array, strs[i]);
|
||||||
|
|
||||||
|
bx = efl_add(EFL_UI_BOX_CLASS, win,
|
||||||
|
efl_content_set(win, efl_added),
|
||||||
|
efl_ui_direction_set(efl_added, EFL_UI_DIR_DOWN));
|
||||||
|
|
||||||
|
efl_add(EFL_UI_TAGS_CLASS, bx,
|
||||||
|
efl_ui_tags_items_set(efl_added, array),
|
||||||
|
efl_event_callback_add(efl_added, EFL_UI_TAGS_EVENT_ITEM_ADDED, _item_added_cb, array),
|
||||||
|
efl_event_callback_add(efl_added, EFL_UI_TAGS_EVENT_ITEM_DELETED, _item_deleted_cb, array),
|
||||||
|
efl_text_set(efl_added, "To :"),
|
||||||
|
efl_pack(bx, efl_added));
|
||||||
|
|
||||||
|
efl_gfx_entity_size_set(win, EINA_SIZE2D(320, 480));
|
||||||
|
}
|
|
@ -321,6 +321,7 @@ typedef Eo Efl_Ui_Focus_Manager;
|
||||||
# include <efl_ui_spin_button.eo.h>
|
# include <efl_ui_spin_button.eo.h>
|
||||||
# include <efl_ui_datepicker.eo.h>
|
# include <efl_ui_datepicker.eo.h>
|
||||||
# include <efl_ui_timepicker.eo.h>
|
# include <efl_ui_timepicker.eo.h>
|
||||||
|
# include <efl_ui_tags.eo.h>
|
||||||
# include <efl_ui_image_factory.eo.h>
|
# include <efl_ui_image_factory.eo.h>
|
||||||
# include <efl_ui_slider_interval.eo.h>
|
# include <efl_ui_slider_interval.eo.h>
|
||||||
# include <efl_ui_layout_factory.eo.h>
|
# include <efl_ui_layout_factory.eo.h>
|
||||||
|
|
File diff suppressed because it is too large
Load Diff
|
@ -0,0 +1,57 @@
|
||||||
|
class Efl.Ui.Tags (Efl.Ui.Layout.Object, Efl.Text, Efl.Ui.Format)
|
||||||
|
{
|
||||||
|
[[Elementary Tags class]]
|
||||||
|
methods {
|
||||||
|
@property editable {
|
||||||
|
[[Control if the tags is to be editable or not.]]
|
||||||
|
set {
|
||||||
|
}
|
||||||
|
get {
|
||||||
|
}
|
||||||
|
values {
|
||||||
|
editable: bool; [[If $true, user can add/delete item in tags, if not, the tags is non-editable.]]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@property expanded {
|
||||||
|
[[Control the tags to expanded state.
|
||||||
|
|
||||||
|
In expanded state, the complete entry will be displayed.
|
||||||
|
Otherwise, only single line of the entry will be displayed.]]
|
||||||
|
set {
|
||||||
|
}
|
||||||
|
get {
|
||||||
|
}
|
||||||
|
values {
|
||||||
|
expanded: bool; [[The value of expanded state. Set this to $true for expanded state. Set
|
||||||
|
this to $false for single line state.]]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
@property items {
|
||||||
|
[[Get a list of items in the tags]]
|
||||||
|
set {
|
||||||
|
}
|
||||||
|
get {
|
||||||
|
}
|
||||||
|
values {
|
||||||
|
items: const(array<string>); [[The array of items, or NULL if none]]
|
||||||
|
}
|
||||||
|
}
|
||||||
|
}
|
||||||
|
implements {
|
||||||
|
Efl.Object.constructor;
|
||||||
|
Efl.Object.destructor;
|
||||||
|
Efl.Ui.Widget.widget_event;
|
||||||
|
Efl.Text.text { get; set; }
|
||||||
|
Efl.Ui.Format.format_cb { set; }
|
||||||
|
}
|
||||||
|
events {
|
||||||
|
item,selected; [[Called when item was selected]]
|
||||||
|
item,added; [[Called when item was added]]
|
||||||
|
item,deleted; [[Called when item was deleted]]
|
||||||
|
item,clicked; [[Called when item was clicked]]
|
||||||
|
item,longpressed; [[Called when item got a longpress]]
|
||||||
|
expanded; [[Called when expanded]]
|
||||||
|
contracted; [[Called when contracted]]
|
||||||
|
expand,state,changed; [[Called when expanded state changed]]
|
||||||
|
}
|
||||||
|
}
|
|
@ -0,0 +1,48 @@
|
||||||
|
#ifndef EFL_UI_TAGS_PRIVATE_H
|
||||||
|
#define EFL_UI_TAGS_PRIVATE_H
|
||||||
|
|
||||||
|
#include "elm_widget_layout.h"
|
||||||
|
|
||||||
|
typedef enum _Tags_View_State
|
||||||
|
{
|
||||||
|
TAGS_VIEW_NONE,
|
||||||
|
TAGS_VIEW_GUIDETEXT,
|
||||||
|
TAGS_VIEW_ENTRY,
|
||||||
|
TAGS_VIEW_SHRINK
|
||||||
|
} Tags_View_State;
|
||||||
|
|
||||||
|
typedef enum _Tags_It_State
|
||||||
|
{
|
||||||
|
TAGS_IT_STATE_DEFAULT,
|
||||||
|
TAGS_IT_STATE_SELECTED,
|
||||||
|
} Tags_It_State;
|
||||||
|
|
||||||
|
typedef struct _Efl_Ui_Tags_Data Efl_Ui_Tags_Data;
|
||||||
|
struct _Efl_Ui_Tags_Data
|
||||||
|
{
|
||||||
|
Eina_Array *it_array;
|
||||||
|
Eina_List *layouts;
|
||||||
|
|
||||||
|
Eo *parent, *box, *label, *end, *entry, *selected_it, *focused_it, *downed_it;
|
||||||
|
|
||||||
|
Tags_View_State view_state;
|
||||||
|
|
||||||
|
Ecore_Timer *longpress_timer;
|
||||||
|
|
||||||
|
const char *label_str, *guide_text_str;
|
||||||
|
int n_str;
|
||||||
|
Evas_Coord w_box, h_box;
|
||||||
|
int shrink;
|
||||||
|
|
||||||
|
Efl_Ui_Format_Func_Cb format_cb;
|
||||||
|
Eina_Free_Cb format_free_cb;
|
||||||
|
void *format_cb_data;
|
||||||
|
Eina_Strbuf *format_strbuf;
|
||||||
|
|
||||||
|
Eina_Bool last_it_select : 1;
|
||||||
|
Eina_Bool editable : 1;
|
||||||
|
Eina_Bool focused : 1;
|
||||||
|
Eina_Bool label_packed : 1;
|
||||||
|
Eina_Bool item_setting : 1;
|
||||||
|
};
|
||||||
|
#endif
|
|
@ -86,6 +86,9 @@ static const Elm_Text_Class _elm_text_classes[] = {
|
||||||
{"multibuttonentry_item_text", "Multibuttonentry Items"},
|
{"multibuttonentry_item_text", "Multibuttonentry Items"},
|
||||||
{"multibuttonentry_item_text_pressed", "Multibuttonentry Pressed Items"},
|
{"multibuttonentry_item_text_pressed", "Multibuttonentry Pressed Items"},
|
||||||
{"multibuttonentry_item_text_disabled", "Multibuttonentry Disabled Items"},
|
{"multibuttonentry_item_text_disabled", "Multibuttonentry Disabled Items"},
|
||||||
|
{"tags_item_text", "Tags Items"},
|
||||||
|
{"tags_item_text_pressed", "Tags Pressed Items"},
|
||||||
|
{"tags_item_text_disabled", "Tags Disabled Items"},
|
||||||
{"title_bar", "Title Bar"},
|
{"title_bar", "Title Bar"},
|
||||||
{"list_item", "List Items"},
|
{"list_item", "List Items"},
|
||||||
{"grid_item", "Grid Items"},
|
{"grid_item", "Grid Items"},
|
||||||
|
@ -162,10 +165,17 @@ static const Elm_Color_Class _elm_color_classes[] = {
|
||||||
{"multibuttonentry_item_text", "Multibuttonentry Item Text"},
|
{"multibuttonentry_item_text", "Multibuttonentry Item Text"},
|
||||||
{"multibuttonentry_item_text_pressed", "Multibuttonentry Item Pressed Text"},
|
{"multibuttonentry_item_text_pressed", "Multibuttonentry Item Pressed Text"},
|
||||||
{"multibuttonentry_item_text_disabled", "Multibuttonentry Item Disabled Text"},
|
{"multibuttonentry_item_text_disabled", "Multibuttonentry Item Disabled Text"},
|
||||||
|
{"tags_bg", "Tags Background"},
|
||||||
|
{"tags_item_bg", "Tags Item Background"},
|
||||||
|
{"tags_item_bg_selected", "Tags Item Selected Background"},
|
||||||
|
{"tags_item_text", "Tags Item Text"},
|
||||||
|
{"tags_item_text_pressed", "Tags Item Pressed Text"},
|
||||||
|
{"tags_item_text_disabled", "Tags Item Disabled Text"},
|
||||||
{"border_title", "Border Title Text"},
|
{"border_title", "Border Title Text"},
|
||||||
{"border_title_active", "Border Title Active Text"},
|
{"border_title_active", "Border Title Active Text"},
|
||||||
{"datetime_text", "Datetime Text"},
|
{"datetime_text", "Datetime Text"},
|
||||||
{"multibuttonentry_label", "Multibuttonentry Text"},
|
{"multibuttonentry_label", "Multibuttonentry Text"},
|
||||||
|
{"tags_label", "Tags Text"},
|
||||||
{"spinner", "Spinner Text"},
|
{"spinner", "Spinner Text"},
|
||||||
{"spinner_disabled", "Spinner Disabled Text"},
|
{"spinner_disabled", "Spinner Disabled Text"},
|
||||||
{NULL, NULL}
|
{NULL, NULL}
|
||||||
|
|
Loading…
Reference in New Issue