hermet pushed a commit to branch master. http://git.enlightenment.org/tools/enventor.git/commit/?id=16d7d8847e216011fbb1f40ef71ae732cb68e0b9
commit 16d7d8847e216011fbb1f40ef71ae732cb68e0b9 Author: Kateryna Fesyna <[email protected]> Date: Wed Aug 13 23:39:25 2014 +0900 Live_Edit: Use template groups as background of new part in Drag-n-Drop mode Summary: Created new groups to setup as bg for dragable area in Drag-n-Drop mode. Reviewers: Hermet Projects: #enventor Differential Revision: https://phab.enlightenment.org/D1323 Conflicts: src/bin/live_edit.c --- data/themes/default/enventor.edc | 1 + data/themes/default/images/Makefile.am | 3 +- data/themes/default/images/spacer.png | Bin 0 -> 154 bytes data/themes/default/layout_common.edc | 6 +-- data/themes/default/live_edit.edc | 73 +++++++++++++++++++++++++++++++++ src/bin/live_edit.c | 14 ++++++- src/include/template_code.h | 2 +- 7 files changed, 93 insertions(+), 6 deletions(-) diff --git a/data/themes/default/enventor.edc b/data/themes/default/enventor.edc index 09e2853..8221c71 100644 --- a/data/themes/default/enventor.edc +++ b/data/themes/default/enventor.edc @@ -8,4 +8,5 @@ collections { #include "theme_ext.edc" #include "layout_common.edc" #include "layout_setting.edc" + #include "live_edit.edc" } diff --git a/data/themes/default/images/Makefile.am b/data/themes/default/images/Makefile.am index c87c980..0e31028 100644 --- a/data/themes/default/images/Makefile.am +++ b/data/themes/default/images/Makefile.am @@ -55,4 +55,5 @@ EXTRA_DIST = \ downlight_glow_left.png \ downlight_glow_right.png \ alarm_highlight.png \ - disabler.png + disabler.png \ + swallow_spacer_mask.png diff --git a/data/themes/default/images/spacer.png b/data/themes/default/images/spacer.png new file mode 100644 index 0000000..8e3a034 Binary files /dev/null and b/data/themes/default/images/spacer.png differ diff --git a/data/themes/default/layout_common.edc b/data/themes/default/layout_common.edc index 3082593..c969764 100644 --- a/data/themes/default/layout_common.edc +++ b/data/themes/default/layout_common.edc @@ -1313,7 +1313,7 @@ group { name: "search_layout"; } } -#define BG_COLOR 88 99 122 +#define BG_COLOR 255 255 255 #define BORDER_COLOR 220 250 255 #define REL_SIZE 70 35 #define INFO_SIZE 130 50 @@ -1330,7 +1330,7 @@ group { name: "live_edit_layout"; } } part { name: "new_part_bg"; - type: RECT; + type: SWALLOW; scale: 1; description { state: "default" 0.0; color: BG_COLOR 0; @@ -1339,7 +1339,7 @@ group { name: "live_edit_layout"; } description { state: "show" 0.0; inherit:"default" 0.0; - color: BG_COLOR 230; + color: BG_COLOR 240; } } part { name: "new_part_bg_decorations"; diff --git a/data/themes/default/live_edit.edc b/data/themes/default/live_edit.edc new file mode 100644 index 0000000..2a66846 --- /dev/null +++ b/data/themes/default/live_edit.edc @@ -0,0 +1,73 @@ +images { + image: "spacer.png" COMP; +} +group { name: "IMAGE_bg"; + parts { + part { name: "logo"; + description { state: "default" 0.0; + image.normal: "logo.png"; + } + } + } +} +group { name: "RECT_bg"; + parts { + part { name: "rect"; + type: RECT; + description { state: "default" 0.0; + color: 0 136 170 255; + } + } + } +} +group { name: "TEXT_bg"; + parts { + part { name: "text"; + type: TEXT; + description { state: "default" 0.0; + color: 255 255 255 255; + text { + size: 10; + font: "Sans"; + text: "TEXT"; + } + } + } + } +} +group { name: "TEXTBLOCK_bg"; + parts { + part { name: "text"; + type: TEXTBLOCK; + description { state: "default" 0.0; + color: 255 255 255 255; + text { + size: 10; + font: "Sans"; + text: "TEXTBLOCK"; + } + } + } + } +} +group { name: "SWALLOW_bg"; + parts { + part { name: "bg"; + description { state: "default" 0.0; + image.normal: "swallow.png"; + color: 255 255 255 155; + } + } + } +} +group { name: "SPACER_bg"; + parts { + part { name: "bg"; + description { state: "default" 0.0; + image.normal: "spacer.png"; + fill.type: TILE; + color: 255 255 255 50; + } + } + } +} diff --git a/src/bin/live_edit.c b/src/bin/live_edit.c index 1b604ba..061dba8 100644 --- a/src/bin/live_edit.c +++ b/src/bin/live_edit.c @@ -167,6 +167,17 @@ new_part_mouse_up_cb(void *data EINA_UNUSED, } static void +new_part_bg_set(live_data *ld) +{ + char buf[PATH_MAX]; + snprintf(buf, sizeof(buf), "%s_bg", + MENU_ITEMS[ld->cur_part_data->type].name); + Evas_Object *bg_layout = elm_layout_add(ld->layout); + elm_layout_file_set(bg_layout, EDJE_PATH, buf); + elm_object_part_content_set(ld->layout, "new_part_bg", bg_layout); +} + +static void live_edit_reset(live_data *ld) { ecore_event_handler_del(ld->key_down_handler); @@ -225,8 +236,9 @@ live_edit_layer_set(live_data *ld) ELM_CURSOR_TOP_LEFT_CORNER); elm_layout_part_cursor_set(layout, "rel2.dragable", ELM_CURSOR_BOTTOM_RIGHT_CORNER); - part_info_update(ld); ld->layout = layout; + new_part_bg_set(ld); + part_info_update(ld); } static void diff --git a/src/include/template_code.h b/src/include/template_code.h index e377cab..e2ea895 100644 --- a/src/include/template_code.h +++ b/src/include/template_code.h @@ -64,7 +64,7 @@ const char *TEMPLATE_PART_RECT[TEMPLATE_PART_RECT_LINE_CNT] = " scale: 1;<br/>", " mouse_events: 1;<br/>", " description { state: \"default\" 0.0;<br/>", - " color: 255 255 255 255;<br/>", + " color: 0 136 170 255;<br/>", " align: 0.5 0.5;<br/>", " fixed: 0 0;<br/>", " min: 0 0;<br/>", --
