jaehwan pushed a commit to branch master.

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

commit b7a62a1c700c7719736b62b83e8b71a51d6ea3d0
Author: Jaehwan Kim <jae.hwan....@samsung.com>
Date:   Thu Mar 31 18:03:06 2016 +0900

    add combobox to change the template themes.
    
    Conflicts:
        data/themes/default/widgets/layouts/tabs.edc
    
    Change-Id: I9b7fdb0870e8b13f24df29e158fc859cbf347e27
---
 data/template/edj/default.edj                | Bin 0 -> 5991443 bytes
 data/themes/default/widgets/layouts/tabs.edc |  25 +++++++++++++++++++++
 src/bin/ui/tab_home_import_edj.c             |  32 ++++++++++++++++++++++++++-
 3 files changed, 56 insertions(+), 1 deletion(-)

diff --git a/data/template/edj/default.edj b/data/template/edj/default.edj
new file mode 100644
index 0000000..0f3ea68
Binary files /dev/null and b/data/template/edj/default.edj differ
diff --git a/data/themes/default/widgets/layouts/tabs.edc 
b/data/themes/default/widgets/layouts/tabs.edc
index cfdc8ad..7d8fefc 100644
--- a/data/themes/default/widgets/layouts/tabs.edc
+++ b/data/themes/default/widgets/layouts/tabs.edc
@@ -707,6 +707,31 @@ group { name: "elm/layout/tab_home/import_edj";
             rel1.to_y: "swallow.meta_version";
          }
       }
+      part { name: "label.widgets";
+         description { state: "default" 0.0;
+            rel2 {
+                relative: 0.0 1.0;
+                to_x: "swallow.all_widgets_check";
+            }
+            text.min: 1 0;
+            text.ellipsis: -1;
+         }
+      }
+      part { name: "swallow.template_themes";
+         type: SWALLOW;
+         insert_after: "label.widgets";
+         description { state: "default" 0.0;
+            rel1 {
+               relative: 1 0.0;
+               to: "label.widgets";
+               offset: 6 0;
+            }
+            rel2 {
+               to_x: "area.widgets_info";
+               to_y: "label.widgets";
+            }
+         }
+      }
    }
 }
    
diff --git a/src/bin/ui/tab_home_import_edj.c b/src/bin/ui/tab_home_import_edj.c
index 8ccca06..e193c1f 100644
--- a/src/bin/ui/tab_home_import_edj.c
+++ b/src/bin/ui/tab_home_import_edj.c
@@ -104,6 +104,7 @@ struct _Tab_Home_Edj
    Meta_Data_Controls meta;
 
    Evas_Object *ch_all;
+   Evas_Object *themes;
    Evas_Object *genlist;
 };
 
@@ -159,7 +160,16 @@ _edj_set()
 {
    Eina_Bool checked = _checked_get();
 
-   if (checked) elm_entry_entry_set(tab_edj.edj, 
EFLETE_TEMPLATE_EDJ_PATH"/default.edj");
+   if (checked)
+     {
+        Ewe_Combobox_Item *item = ewe_combobox_select_item_get(tab_edj.themes);
+        char buf[256];
+        if (item)
+          {
+             snprintf(buf, sizeof(buf), "%s/%s", EFLETE_TEMPLATE_EDJ_PATH, 
item->title);
+             elm_entry_entry_set(tab_edj.edj, buf);
+          }
+     }
    else elm_entry_entry_set(tab_edj.edj, "");
    elm_object_disabled_set(tab_edj.edj, checked);
 
@@ -231,6 +241,15 @@ _on_item_activated(void *data __UNUSED__,
 }
 
 static void
+_template_theme_changed(void *data __UNUSED__,
+                        Evas_Object *obj __UNUSED__,
+                        void *event_info __UNUSED__)
+{
+   _edj_set();
+
+}
+
+static void
 _progress_end(void *data, PM_Project_Result result)
 {
    if (PM_PROJECT_SUCCESS == result)
@@ -365,6 +384,8 @@ _tab_import_edj_add(void)
 {
    Elm_Genlist_Item_Class *itc = NULL;
    Widget_Item_Data *widget_item_data_iterator = widget_item_data;
+   Eina_List *themes = NULL, *l = NULL;
+   char *theme;
 
    tab_edj.name_validator = elm_validator_regexp_new(NAME_REGEX, NULL);
 
@@ -406,6 +427,15 @@ _tab_import_edj_add(void)
    elm_object_part_content_set(tab_edj.layout, "swallow.all_widgets_check", 
tab_edj.ch_all);
    elm_object_part_text_set(tab_edj.layout, "label.widgets", _("Widgets:"));
 
+   /* template themes */
+   EWE_COMBOBOX_ADD(tab_edj.layout, tab_edj.themes);
+   elm_object_part_content_set(tab_edj.layout, "swallow.template_themes", 
tab_edj.themes);
+   ewe_combobox_text_set(tab_edj.themes, "template themes");
+   themes = ecore_file_ls(EFLETE_TEMPLATE_EDJ_PATH);
+   EINA_LIST_FOREACH(themes, l, theme)
+      ewe_combobox_item_add(tab_edj.themes, theme);
+   evas_object_smart_callback_add(tab_edj.themes, "selected", 
_template_theme_changed, NULL);
+
    /* genlist */
    tab_edj.genlist = elm_genlist_add(ap.win);
    evas_object_smart_callback_add(tab_edj.genlist, "activated", 
_on_item_activated, NULL);

-- 


Reply via email to