rimmed pushed a commit to branch master.

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

commit 1a03ef0767b00d7bed3c68a417d0e67f31af5cb1
Author: Mykola Solyanko <m.solya...@samsung.com>
Date:   Tue Dec 8 11:45:05 2015 +0200

    colorclass_manager: change UI
---
 data/themes/default/widgets/layout.edc       |  27 ++++-
 data/themes/default/widgets/layouts/tabs.edc |   8 +-
 src/bin/ui/editors/colorclass_manager.c      | 152 ++++++++++++++++-----------
 src/bin/ui/editors/style_editor.c            |  10 +-
 4 files changed, 124 insertions(+), 73 deletions(-)

diff --git a/data/themes/default/widgets/layout.edc 
b/data/themes/default/widgets/layout.edc
index 0ed4de8..8c0255e 100644
--- a/data/themes/default/widgets/layout.edc
+++ b/data/themes/default/widgets/layout.edc
@@ -387,9 +387,26 @@ group { name: "elm/layout/block/default";
    }
 }
 
-group { name: "elm/layout/style_editor/font_list";
+group{ name: "elm/layout/colorclass_editor/preview";
    parts {
-      part { name: "label.font_list";
+      part { name: "swallow.entry.bg";
+         type: SWALLOW;
+         description { state: "default" 0.0;
+         }
+      }
+      part { name: "swallow.entry";
+         type: SWALLOW;
+         description { state: "default" 0.0;
+            rel1.to: "swallow.entry.bg";
+            rel2.to: "swallow.entry.bg";
+         }
+      }
+   }
+}
+
+group { name: "elm/layout/style_color_editor/list";
+   parts {
+      part { name: "label.list";
          type: TEXT;
          scale: 1;
          description { state: "default" 0.0;
@@ -410,7 +427,7 @@ group { name: "elm/layout/style_editor/font_list";
             align: 0.0 0.0;
             FIXED_SIZE(31, 21);
             rel1 {
-               to: "label.font_list";
+               to: "label.list";
                relative: 1.0 0.0;
             }
          }
@@ -444,7 +461,7 @@ group { name: "elm/layout/style_editor/font_list";
             fixed: 0 1;
             max: -1 6;
             rel1 {
-               to: "label.font_list";
+               to: "label.list";
                relative: 0.0 1.0;
             }
          }
@@ -481,7 +498,7 @@ group { name: "elm/layout/style_editor/font_list";
             }
          }
       }
-      part { name: "swallow.font_list";
+      part { name: "swallow.list";
          type: SWALLOW;
          description { state: "default" 0.0;
             rel1 {
diff --git a/data/themes/default/widgets/layouts/tabs.edc 
b/data/themes/default/widgets/layouts/tabs.edc
index caf22ea..dc98663 100644
--- a/data/themes/default/widgets/layouts/tabs.edc
+++ b/data/themes/default/widgets/layouts/tabs.edc
@@ -1302,7 +1302,7 @@ group { name: "elm/layout/tab_home/item";
    }
 }
 
-group { name: "elm/layout/tab_style/style_editor";
+group { name: "elm/layout/tab_style/style_color_editor";
    images {
       image: "separator-vertical.png" COMP;
       image: "separator-horizontal.png" COMP;
@@ -1396,7 +1396,7 @@ group { name: "elm/layout/tab_style/style_editor";
             }
          }
       }
-      part { name: "swallow.font_list";
+      part { name: "swallow.list";
          type: SWALLOW;
          description { state: "default" 0.0;
             align: 1.0 1.0;
@@ -1420,11 +1420,11 @@ group { name: "elm/layout/tab_style/style_editor";
             min: 6 1;
             max: 6 -1;
             rel1 {
-               to: "swallow.font_list";
+               to: "swallow.list";
                relative: 0.0 0.0;
             }
             rel2 {
-               to: "swallow.font_list";
+               to: "swallow.list";
                relative: 0.0 1.0;
             }
          }
diff --git a/src/bin/ui/editors/colorclass_manager.c 
b/src/bin/ui/editors/colorclass_manager.c
index 91431fc..1e47ab2 100644
--- a/src/bin/ui/editors/colorclass_manager.c
+++ b/src/bin/ui/editors/colorclass_manager.c
@@ -204,7 +204,8 @@ _change_bg_cb(void *data,
    assert(edit != NULL);
 
    int state = elm_radio_state_value_get(obj);
-   Evas_Object *bg = elm_object_part_content_unset(edit->layout, 
"swallow.entry.bg");
+   Evas_Object *preview_layout = elm_object_part_content_get(edit->layout, 
"swallow.preview");
+   Evas_Object *bg = elm_object_part_content_unset(preview_layout, 
"swallow.entry.bg");
    evas_object_del(bg);
    Evas *canvas = evas_object_evas_get(obj);
    switch (state)
@@ -237,7 +238,7 @@ _change_bg_cb(void *data,
       break;
      }
 
-   elm_object_part_content_set(edit->layout, "swallow.entry.bg", bg);
+   elm_object_part_content_set(preview_layout, "swallow.entry.bg", bg);
 }
 
 static void
@@ -399,25 +400,11 @@ _item_ccl_del(void *data,
    free(ccl_it);
    ccl_it = NULL;
 }
-static void
-_colorclass_main_layout_create(Colorclasses_Manager *edit)
-{
-   Evas_Object *search, *bg, *box_bg, *radio, *radio_group, *image_bg, *ic, 
*button;
-
-   assert(edit != NULL);
-
-   /* Creating main layout of window */
-   edit->layout = elm_layout_add(ap.win);
-   elm_layout_theme_set(edit->layout, "layout", "colorclass_manager", 
"default");
-   evas_object_size_hint_weight_set(edit->layout, EVAS_HINT_EXPAND, 
EVAS_HINT_EXPAND);
 
-   /* List of project's colorclasses */
-   edit->genlist = elm_genlist_add(edit->layout);
-   evas_object_size_hint_weight_set(edit->genlist, EVAS_HINT_EXPAND, 
EVAS_HINT_EXPAND);
-   evas_object_size_hint_align_set(edit->genlist, EVAS_HINT_FILL, 
EVAS_HINT_FILL);
-   evas_object_show(edit->genlist);
-   elm_object_part_content_set(edit->layout, "swallow.list", edit->genlist);
-   evas_object_smart_callback_add(edit->genlist, "selected", _on_selected, 
edit);
+static Evas_Object *
+_form_list_side(Colorclasses_Manager *edit)
+{
+   Evas_Object *layout, *search, *ic, *button;
 
    if (!_itc_ccl)
      {
@@ -427,9 +414,22 @@ _colorclass_main_layout_create(Colorclasses_Manager *edit)
         _itc_ccl->func.del = _item_ccl_del;
      }
 
-   /* Search engine */
-   search = _manager_search_field_create(edit->layout);
-   elm_object_part_content_set(edit->layout, "swallow.search", search);
+   layout = elm_layout_add(ap.win);
+   evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, 
EVAS_HINT_EXPAND);
+   elm_layout_theme_set(layout, "layout", "style_color_editor", "list");
+   elm_object_part_text_set(layout, "label.list", _("Color list"));
+   evas_object_show(layout);
+
+   /* List of project's colorclasses */
+   edit->genlist = elm_genlist_add(layout);
+   evas_object_size_hint_weight_set(edit->genlist, EVAS_HINT_EXPAND, 
EVAS_HINT_EXPAND);
+   evas_object_size_hint_align_set(edit->genlist, EVAS_HINT_FILL, 
EVAS_HINT_FILL);
+   evas_object_show(edit->genlist);
+   elm_object_part_content_set(layout, "swallow.list", edit->genlist);
+   evas_object_smart_callback_add(edit->genlist, "selected", _on_selected, 
edit);
+
+   search = _manager_search_field_create(layout);
+   elm_object_part_content_set(layout, "swallow.search", search);
    evas_object_smart_callback_add(search, "changed", _search_changed, edit);
    evas_object_smart_callback_add(search, "activated", _search_nxt_gd_item, 
edit);
    evas_object_smart_callback_add(edit->genlist, "pressed", _search_reset_cb,
@@ -437,12 +437,55 @@ _colorclass_main_layout_create(Colorclasses_Manager *edit)
    edit->style_search_data.search_entry = search;
    edit->style_search_data.last_item_found = NULL;
 
+   /* Controls (add, remove) of colorclasses */
+   button = elm_button_add(layout);
+   evas_object_show(button);
+   ICON_STANDARD_ADD(button, ic, true, "plus");
+   elm_object_part_content_set(button, NULL, ic);
+   evas_object_smart_callback_add(button, "clicked",
+                                  _on_button_add_clicked_cb, edit);
+   elm_object_part_content_set(layout, "swallow.button_add", button);
+
+   button = elm_button_add(layout);
+   evas_object_show(button);
+   ICON_STANDARD_ADD(button, ic, true, "minus");
+   elm_object_part_content_set(button, NULL, ic);
+   evas_object_smart_callback_add(button, "clicked",
+                                  _on_button_delete_clicked_cb, edit);
+   elm_object_part_content_set(layout, "swallow.button_rm", button);
+
+   return layout;
+}
+
+static void
+_colorclass_main_layout_create(Colorclasses_Manager *edit)
+{
+   Evas_Object *layout_list, *bg, *box_bg, *radio, *radio_group, *image_bg, 
*layout_bg, *btn_apply;
+
+   assert(edit != NULL);
+
+   /* Creating main layout of window */
+   edit->layout = elm_layout_add(ap.win);
+   elm_layout_theme_set(edit->layout, "layout", "tab_style", 
"style_color_editor");
+   evas_object_size_hint_weight_set(edit->layout, EVAS_HINT_EXPAND, 
EVAS_HINT_EXPAND);
+
+   elm_object_part_text_set(edit->layout, "label.preview", _("Preview"));
+
+   layout_list = _form_list_side(edit);
+   elm_object_part_content_set(edit->layout, "swallow.list", layout_list);
+   evas_object_show(layout_list);
+
+
+   layout_bg = elm_layout_add(edit->layout);
+   elm_layout_theme_set(layout_bg, "layout", "colorclass_editor", "preview");
+   evas_object_size_hint_weight_set(layout_bg, EVAS_HINT_EXPAND, 
EVAS_HINT_EXPAND);
+
    /* Entry preview to show colorclass */
-   IMAGE_ADD_NEW(edit->layout, bg, "bg", "tile");
-   elm_object_part_content_set(edit->layout, "swallow.entry.bg", bg);
+   IMAGE_ADD_NEW(layout_bg, bg, "bg", "tile");
+   elm_object_part_content_set(layout_bg, "swallow.entry.bg", bg);
    evas_object_show(bg);
 
-   edit->edje_preview = edje_object_add(evas_object_evas_get(ap.win));
+   edit->edje_preview = edje_object_add(evas_object_evas_get(layout_bg));
    if (!edje_object_file_set(edit->edje_preview,
                              EFLETE_THEME,
                              "elm/layout/colorclass_manager/preview"))
@@ -454,28 +497,14 @@ _colorclass_main_layout_create(Colorclasses_Manager *edit)
                        _("The quick brown fox jumps over the lazy dog"));
    evas_object_size_hint_align_set(edit->edje_preview, -1, -1);
    evas_object_show(edit->edje_preview);
-   elm_object_part_content_set(edit->layout, "swallow.entry", 
edit->edje_preview);
-
-   /* Creating colorselectors */
-#define ADD_COLORSEL(NUMBER, SWALLOW_NAME, COLORSEL_NAME) \
-   edit->colorsel##NUMBER = elm_colorselector_add(edit->layout); \
-   elm_colorselector_mode_set(edit->colorsel##NUMBER, ELM_COLORSELECTOR_ALL); \
-   elm_object_part_content_set(edit->layout, 
"swallow.colorselector."SWALLOW_NAME, edit->colorsel##NUMBER); \
-   elm_object_part_text_set(edit->layout, "text."SWALLOW_NAME, COLORSEL_NAME); 
\
-   evas_object_smart_callback_add(edit->colorsel##NUMBER, "changed,user", 
_on_changed_##NUMBER, edit); \
-   evas_object_smart_callback_add(edit->colorsel##NUMBER, 
"color,item,selected", _on_changed_##NUMBER, edit); \
-   elm_object_disabled_set(edit->colorsel##NUMBER, true);
-
-   ADD_COLORSEL(1, "object", _("Object color"));
-   ADD_COLORSEL(2, "outline", _("Outline color"));
-   ADD_COLORSEL(3, "shadow", _("Shadow color"));
-
-#undef ADD_COLORSEL
+   elm_object_part_content_set(layout_bg, "swallow.entry", edit->edje_preview);
 
+   elm_object_part_content_set(edit->layout, "swallow.preview", layout_bg);
 
    /* Background changing radios */
    BOX_ADD(edit->layout, box_bg, true, false);
    elm_box_padding_set(box_bg, 10, 0);
+   elm_box_align_set(box_bg, 1.0, 0.5);
 
 #define _RADIO_ADD(RADIO, VALUE, IMAGE) \
    RADIO = elm_radio_add(edit->layout); \
@@ -494,25 +523,30 @@ _colorclass_main_layout_create(Colorclasses_Manager *edit)
    elm_radio_group_add(radio, radio_group);
 #undef _RADIO_ADD
 
-   elm_object_part_content_set(edit->layout, "swallow.radio", box_bg);
+   elm_object_part_content_set(edit->layout, "menu_container", box_bg);
 
-   /* Controls (add, remove) of colorclasses */
-   button = elm_button_add(edit->layout);
-   evas_object_show(button);
-   ICON_STANDARD_ADD(button, ic, true, "plus");
-   elm_object_part_content_set(button, NULL, ic);
-   evas_object_smart_callback_add(button, "clicked",
-                                  _on_button_add_clicked_cb, edit);
-   elm_object_part_content_set(edit->layout, "swallow.control.add", button);
+   BUTTON_ADD(edit->layout, btn_apply, _("Apply"))
+   elm_object_part_content_set(edit->layout, "elm.swallow.btn_apply", 
btn_apply);
+   elm_object_disabled_set(btn_apply, EINA_TRUE);
+
+   /* Creating colorselectors */
+#define ADD_COLORSEL(NUMBER, SWALLOW_NAME, COLORSEL_NAME) \
+   edit->colorsel##NUMBER = elm_colorselector_add(edit->layout); \
+   elm_colorselector_mode_set(edit->colorsel##NUMBER, ELM_COLORSELECTOR_ALL); \
+   elm_object_part_content_set(edit->layout, 
"swallow.colorselector."SWALLOW_NAME, edit->colorsel##NUMBER); \
+   elm_object_part_text_set(edit->layout, "text."SWALLOW_NAME, COLORSEL_NAME); 
\
+   evas_object_smart_callback_add(edit->colorsel##NUMBER, "changed,user", 
_on_changed_##NUMBER, edit); \
+   evas_object_smart_callback_add(edit->colorsel##NUMBER, 
"color,item,selected", _on_changed_##NUMBER, edit); \
+   elm_object_disabled_set(edit->colorsel##NUMBER, true);
+
+   ADD_COLORSEL(1, "object", _("Object color"));
+   ADD_COLORSEL(2, "outline", _("Outline color"));
+   ADD_COLORSEL(3, "shadow", _("Shadow color"));
+
+#undef ADD_COLORSEL
 
-   button = elm_button_add(edit->layout);
-   evas_object_show(button);
-   ICON_STANDARD_ADD(button, ic, true, "minus");
-   elm_object_part_content_set(button, NULL, ic);
-   evas_object_smart_callback_add(button, "clicked",
-                                  _on_button_delete_clicked_cb, edit);
-   elm_object_part_content_set(edit->layout, "swallow.control.minus", button);
 }
+
 Eina_Bool
 _colorclass_manager_init(Colorclasses_Manager *edit)
 {
diff --git a/src/bin/ui/editors/style_editor.c 
b/src/bin/ui/editors/style_editor.c
index fdff08b..a23758e 100644
--- a/src/bin/ui/editors/style_editor.c
+++ b/src/bin/ui/editors/style_editor.c
@@ -798,8 +798,8 @@ _form_right_side(Style_Editor *style_edit)
 
    layout = elm_layout_add(ap.win);
    evas_object_size_hint_weight_set(layout, EVAS_HINT_EXPAND, 
EVAS_HINT_EXPAND);
-   elm_layout_theme_set(layout, "layout", "style_editor", "font_list");
-   elm_object_part_text_set(layout, "label.font_list", _("Font list"));
+   elm_layout_theme_set(layout, "layout", "style_color_editor", "list");
+   elm_object_part_text_set(layout, "label.list", _("Font list"));
    evas_object_show(layout);
 
    search = _style_editor_search_field_create(layout);
@@ -812,7 +812,7 @@ _form_right_side(Style_Editor *style_edit)
    style_edit->style_search_data.last_item_found = NULL;
 
    style_edit->glist = elm_genlist_add(layout);
-   elm_object_part_content_set(layout, "swallow.font_list", style_edit->glist);
+   elm_object_part_content_set(layout, "swallow.list", style_edit->glist);
    evas_object_smart_callback_add(style_edit->glist, "clicked,double", 
_on_clicked_double, NULL);
    evas_object_smart_callback_add(style_edit->glist, "expand,request", 
_expand_request_cb, NULL);
    evas_object_smart_callback_add(style_edit->glist, "expanded", _expanded_cb, 
style_edit);
@@ -952,7 +952,7 @@ style_editor_window_add()
    style_edit = (Style_Editor *)mem_calloc(1, sizeof(Style_Editor));
 
    main_layout = elm_layout_add(ap.win);
-   elm_layout_theme_set(main_layout, "layout", "tab_style", "style_editor");
+   elm_layout_theme_set(main_layout, "layout", "tab_style", 
"style_color_editor");
    elm_object_part_text_set(main_layout, "label.preview", _("Preview"));
 
    style_edit->entry_prev = elm_layout_add(main_layout);
@@ -978,7 +978,7 @@ style_editor_window_add()
    elm_object_part_content_set(main_layout, "swallow.preview", 
style_edit->entry_prev);
 
    layout_right = _form_right_side(style_edit);
-   elm_object_part_content_set(main_layout, "swallow.font_list", layout_right);
+   elm_object_part_content_set(main_layout, "swallow.list", layout_right);
    evas_object_show(layout_right);
 
    box_bg = _add_box_bg(style_edit);

-- 


Reply via email to