rimmed pushed a commit to branch master.

http://git.enlightenment.org/tools/eflete.git/commit/?id=f2829399cb1b8658e082460f02b2732d3bba4aad

commit f2829399cb1b8658e082460f02b2732d3bba4aad
Author: Vyacheslav Reutskiy <v.reuts...@samsung.com>
Date:   Thu Jul 23 13:41:35 2015 +0300

    Styles: use layouts for default Eflete theme
    
    Change-Id: I52d75a5bf2fa500c171f21e6b2e1bf7ff5f22fc7
---
 src/bin/common/widget_macro.h     |  8 --------
 src/bin/ui/dialogs/item_dialog.c  |  4 ++--
 src/bin/ui/dialogs/state_dialog.c | 13 ++++++-------
 src/bin/ui/dialogs/style_dialog.c |  4 ++--
 src/bin/ui/editors/animator.c     |  2 +-
 src/bin/ui/editors/sound_editor.c |  4 ++--
 src/bin/ui/editors/style_editor.c |  6 ++----
 7 files changed, 15 insertions(+), 26 deletions(-)

diff --git a/src/bin/common/widget_macro.h b/src/bin/common/widget_macro.h
index 56421aa..78a412d 100644
--- a/src/bin/common/widget_macro.h
+++ b/src/bin/common/widget_macro.h
@@ -46,14 +46,6 @@ TODO("see large comment below")
    elm_layout_text_set(item, NULL, NAME); \
    evas_object_show(item);
 
-#define ITEM_ADD(PARENT, ITEM, TEXT, STYLE) \
-   ITEM = elm_layout_add(PARENT); \
-   evas_object_size_hint_weight_set(ITEM, EVAS_HINT_EXPAND, 0.0); \
-   evas_object_size_hint_align_set(ITEM, EVAS_HINT_FILL, 0.0); \
-   elm_layout_file_set(ITEM, EFLETE_EDJ, STYLE); \
-   elm_object_part_text_set(ITEM, "elm.text", TEXT); \
-   evas_object_show(ITEM);
-
 #define BOX_ADD(PARENT, BOX, ISHORIZONTAL, ISHOMOGENEOS) \
    BOX = elm_box_add(PARENT); \
    evas_object_size_hint_weight_set(BOX, EVAS_HINT_EXPAND, 0.0); \
diff --git a/src/bin/ui/dialogs/item_dialog.c b/src/bin/ui/dialogs/item_dialog.c
index 4343097..bc32e7f 100644
--- a/src/bin/ui/dialogs/item_dialog.c
+++ b/src/bin/ui/dialogs/item_dialog.c
@@ -190,7 +190,7 @@ item_dialog_add(App_Data *ap, Part *part)
 
    BOX_ADD(ap->popup, box, false, false);
 
-   ITEM_ADD(box, item, _("Name:"), "eflete/property/item/small_label")
+   LAYOUT_PROP_ADD(box, _("Name:"), "property", "1swallow")
    ENTRY_ADD(item, entry, true);
    eo_do(entry, eo_event_callback_add(ELM_ENTRY_EVENT_VALIDATE, 
elm_validator_regexp_helper, name_validator));
    evas_object_smart_callback_add(entry, "changed", _validation, NULL);
@@ -198,7 +198,7 @@ item_dialog_add(App_Data *ap, Part *part)
    elm_object_part_content_set(item, "elm.swallow.content", entry);
    elm_box_pack_end(box, item);
 
-   ITEM_ADD(box, item, _("Source:"), "eflete/property/item/small_label")
+   LAYOUT_PROP_ADD(box, _("Source:"), "property", "1swallow")
    EWE_COMBOBOX_ADD(item, combobox)
    ewe_combobox_item_add(combobox, _("None"));
    ewe_combobox_select_item_set(combobox, 0);
diff --git a/src/bin/ui/dialogs/state_dialog.c 
b/src/bin/ui/dialogs/state_dialog.c
index d8c26d2..c4bf45d 100644
--- a/src/bin/ui/dialogs/state_dialog.c
+++ b/src/bin/ui/dialogs/state_dialog.c
@@ -149,7 +149,6 @@ Evas_Object *
 state_dialog_state_add(App_Data *ap)
 {
    Evas_Object *box, *item, *bt_no;
-   Evas_Object *item_dup;
    Part *part = NULL;
    Eina_Stringshare *title = NULL;
    Eina_List *states = NULL, *l = NULL;
@@ -174,7 +173,7 @@ state_dialog_state_add(App_Data *ap)
 
    BOX_ADD(ap->popup, box, false, false);
 
-   ITEM_ADD(box, item, _("Name:"), "eflete/property/item/default")
+   LAYOUT_PROP_ADD(box, _("Name:"), "property", "1swallow")
    ENTRY_ADD(item, entry_name, true);
    eo_do(entry_name, eo_event_callback_add(ELM_ENTRY_EVENT_VALIDATE, 
elm_validator_regexp_helper, name_validator));
    evas_object_smart_callback_add(entry_name, "changed", _on_entry_changed, 
NULL);
@@ -182,7 +181,7 @@ state_dialog_state_add(App_Data *ap)
    elm_object_part_content_set(item, "elm.swallow.content", entry_name);
    elm_box_pack_end(box, item);
 
-   ITEM_ADD(box, item, _("Value:"), "eflete/property/item/default")
+   LAYOUT_PROP_ADD(box, _("Value:"), "property", "1swallow")
    ENTRY_ADD(item, entry_value, true);
    eo_do(entry_value, eo_event_callback_add(ELM_ENTRY_EVENT_VALIDATE, 
elm_validator_regexp_helper, value_validator));
    evas_object_smart_callback_add(entry_value, "changed", _on_entry_changed, 
NULL);
@@ -192,8 +191,8 @@ state_dialog_state_add(App_Data *ap)
    elm_object_part_content_set(item, "elm.swallow.content", entry_value);
    elm_box_pack_end(box, item);
 
-   ITEM_ADD(box, item_dup, _("Duplicate state:"), 
"eflete/property/item/default")
-   EWE_COMBOBOX_ADD(item_dup, combobox_dup_state)
+   LAYOUT_PROP_ADD(box, _("Duplicate state:"), "property", "1swallow")
+   EWE_COMBOBOX_ADD(item, combobox_dup_state)
 
    states = edje_edit_part_states_list_get(ap->project->current_style->obj, 
part->name);
 
@@ -203,12 +202,12 @@ state_dialog_state_add(App_Data *ap)
      {
        ewe_combobox_item_add(combobox_dup_state, state_name);
      }
-   elm_object_part_content_set(item_dup, "elm.swallow.content", 
combobox_dup_state);
+   elm_object_part_content_set(item, "elm.swallow.content", 
combobox_dup_state);
    evas_object_smart_callback_add(combobox_dup_state, "selected",
                                   _on_dup_state_change, part);
    edje_edit_string_list_free(states);
 
-   elm_box_pack_end(box, item_dup);
+   elm_box_pack_end(box, item);
    elm_object_content_set(ap->popup, box);
 
    BUTTON_ADD(ap->popup, btn_add, _("Add"));
diff --git a/src/bin/ui/dialogs/style_dialog.c 
b/src/bin/ui/dialogs/style_dialog.c
index ae3848c..89d6c43 100644
--- a/src/bin/ui/dialogs/style_dialog.c
+++ b/src/bin/ui/dialogs/style_dialog.c
@@ -338,7 +338,7 @@ style_dialog_add(App_Data *ap)
    class_st = ui_class_from_ap_get(ap);
    entry_text = eina_stringshare_add(class_st->name);
 
-   ITEM_ADD(box, item, "Class name:", "eflete/property/item/default")
+   LAYOUT_PROP_ADD(box, _("Class name:"), "property", "1swallow")
    ENTRY_ADD(box, entry_class, true);
    eo_do(entry_class, eo_event_callback_add(ELM_ENTRY_EVENT_VALIDATE, 
elm_validator_regexp_helper, class_validator));
    elm_entry_entry_set(entry_class, entry_text);
@@ -347,7 +347,7 @@ style_dialog_add(App_Data *ap)
    elm_object_part_content_set(item, "elm.swallow.content", entry_class);
    elm_box_pack_end(box, item);
 
-   ITEM_ADD(box, item, "Style name:", "eflete/property/item/default")
+   LAYOUT_PROP_ADD(box, _("Style name:"), "property", "1swallow")
    ENTRY_ADD(item, entry_style, true);
    eo_do(entry_style, eo_event_callback_add(ELM_ENTRY_EVENT_VALIDATE, 
elm_validator_regexp_helper, style_validator));
    evas_object_smart_callback_add(entry_style, "changed", _on_entry_changed, 
NULL);
diff --git a/src/bin/ui/editors/animator.c b/src/bin/ui/editors/animator.c
index fcf331a..90a3148 100644
--- a/src/bin/ui/editors/animator.c
+++ b/src/bin/ui/editors/animator.c
@@ -357,7 +357,7 @@ _on_bt_prog_add(void *data,
                             _("New program"));
 
    animator->popup.name_validator = elm_validator_regexp_new(NAME_REGEX, NULL);
-   ITEM_ADD(animator->popup.popup, item, _("Program name:"), 
"eflete/property/item/default");
+   LAYOUT_PROP_ADD(animator->popup.popup, _("Frequency:"), "property", 
"1swallow")
    ENTRY_ADD(item, animator->popup.entry, true)
    eo_do(animator->popup.entry,
          eo_event_callback_add(ELM_ENTRY_EVENT_VALIDATE, 
elm_validator_regexp_helper, animator->popup.name_validator));
diff --git a/src/bin/ui/editors/sound_editor.c 
b/src/bin/ui/editors/sound_editor.c
index 853aa82..7b1eebd 100644
--- a/src/bin/ui/editors/sound_editor.c
+++ b/src/bin/ui/editors/sound_editor.c
@@ -1504,7 +1504,7 @@ _tone_add_cb(void *data,
 
    BOX_ADD(popup, box, false, false);
    elm_object_content_set(popup, box);
-   ITEM_ADD(box, item, _("tone name:"), "property/item/editor");
+   LAYOUT_PROP_ADD(box, _("Tone name:"), "property", "1swallow")
    ENTRY_ADD(item, edit->tone_entry, true);
    eo_do(edit->tone_entry, eo_event_callback_add(ELM_ENTRY_EVENT_VALIDATE, 
elm_validator_regexp_helper, edit->tone_validator));
    evas_object_smart_callback_add(edit->tone_entry, "changed", _validation, 
edit);
@@ -1514,7 +1514,7 @@ _tone_add_cb(void *data,
    elm_object_part_content_set(item, "elm.swallow.content", edit->tone_entry);
    elm_box_pack_end(box, item);
 
-   ITEM_ADD(box, item, _("frequency:"), "property/item/editor");
+   LAYOUT_PROP_ADD(box, _("Frequency:"), "property", "1swallow")
    ENTRY_ADD(item, edit->frq_entry, true);
    eo_do(edit->frq_entry, eo_event_callback_add(ELM_ENTRY_EVENT_VALIDATE, 
elm_validator_regexp_helper, edit->frq_validator));
    evas_object_smart_callback_add(edit->frq_entry, "changed", _validation, 
edit);
diff --git a/src/bin/ui/editors/style_editor.c 
b/src/bin/ui/editors/style_editor.c
index cbe8460..eed105b 100644
--- a/src/bin/ui/editors/style_editor.c
+++ b/src/bin/ui/editors/style_editor.c
@@ -514,10 +514,9 @@ _on_bt_style_add(Style_Editor *style_edit)
    elm_object_part_text_set(POPUP.dialog, "title,text", _("Add textblock 
style"));
 
    BOX_ADD(POPUP.dialog, box, false, false);
-   ITEM_ADD(box, item, "Style name:", "eflete/property/item/default")
 
+   LAYOUT_PROP_ADD(box, _("Style name:"), "property", "1swallow")
    POPUP.name_validator = elm_validator_regexp_new(NAME_REGEX, NULL);
-
    ENTRY_ADD(item, POPUP.name, true);
    eo_do(POPUP.name, eo_event_callback_add(ELM_ENTRY_EVENT_VALIDATE, 
elm_validator_regexp_helper, POPUP.name_validator));
    evas_object_smart_callback_add(POPUP.name, "changed", _validate, 
style_edit);
@@ -575,10 +574,9 @@ _on_bt_tag_add(Style_Editor *style_edit)
    elm_object_part_text_set(POPUP.dialog, "title,text", buf);
 
    BOX_ADD(POPUP.dialog, box, false, false);
-   ITEM_ADD(box, item, "Tag name:", "eflete/property/item/default")
 
+   LAYOUT_PROP_ADD(box, "Tag name:", "property", "1swallow")
    POPUP.name_validator = elm_validator_regexp_new(NAME_REGEX, NULL);
-
    ENTRY_ADD(item, POPUP.name, true);
    eo_do(POPUP.name, eo_event_callback_add(ELM_ENTRY_EVENT_VALIDATE, 
elm_validator_regexp_helper, POPUP.name_validator));
    evas_object_smart_callback_add(POPUP.name, "changed", _validate, 
style_edit);

-- 


Reply via email to