From 9f6d2b667c13a810582ea957c1be171d26827cd7 Mon Sep 17 00:00:00 2001 From: codewarrior Date: Thu, 3 Nov 2005 15:26:46 +0000 Subject: [PATCH] - work on icon thumbs, give them their own theme part. SVN revision: 18254 --- data/themes/default_fileman.edc | 332 ++++++++++++++++++++ data/themes/images/Makefile.am | 1 + data/themes/images/e17_fileman_thumb_bg.png | Bin 0 -> 291 bytes src/bin/e_fileman_icon.c | 40 ++- src/bin/e_fileman_smart.c | 2 +- 5 files changed, 368 insertions(+), 7 deletions(-) create mode 100644 data/themes/images/e17_fileman_thumb_bg.png diff --git a/data/themes/default_fileman.edc b/data/themes/default_fileman.edc index 59c3b9b2e..aa829229e 100644 --- a/data/themes/default_fileman.edc +++ b/data/themes/default_fileman.edc @@ -152,6 +152,8 @@ images image: "e17_logo.png" COMP; image: "e17_button.png" COMP; + image: "e17_fileman_thumb_bg.png" COMP; + image: "e17_mini_button_shadow2.png" COMP; } styles @@ -1065,6 +1067,336 @@ group { } } + +group { + name: "fileman/icon_thumb"; + parts { + part { + name: "icon_box_shadow"; + mouse_events: 0; + description { + state: "default" 0.0; + rel1 { + to: "icon_box"; + relative: 0.0 0.0; + offset: 3 3; + } + rel2 { + to: "icon_box"; + relative: 1.0 1.0; + offset: 3 3; + } + image { + normal: "e17_mini_button_shadow2.png"; + border: 6 6 6 6; + } + } + } + part { + name: "icon_box"; + type: RECT; + mouse_events: 0; + description { + state: "default" 0.0; + align: 0.5 0.5; + rel1 { + relative: 0.0 0.0; + offset: 0 0; + } + rel2 { + relative: 1.0 1.0; + offset: -6 -6; + } + color: 0 0 0 255; + } + } + part { + name: "icon_box_bg"; + mouse_events: 0; + description { + state: "default" 0.0; + rel1 { + to: "icon_box"; + relative: 0.0 0.0; + offset: 1 1; + } + rel2 { + to: "icon_box"; + relative: 1.0 1.0; + offset: -2 -2; + } + image { + normal: "e17_fileman_thumb_bg.png"; + } + fill { + smooth: 0; + size { + relative: 0 0; + offset: 32 32; + } + } + } + } + part { + name: "icon_swallow"; + type: SWALLOW; + mouse_events: 0; + description { + state: "default" 0.0; + rel1 { + to: "icon_box_bg"; + } + rel2 { + to: "icon_box_bg"; + } + } + } + } +} + +group { + name: "fileman/icon_thumb_normal2"; + min: 48 48; + max: 128 9999; + parts { + part { + /* this is used for debugging */ + name: "ghost"; + type: RECT; + description { + state: "default" 0.0; + visible: 0; + color: 128 128 128 128; + } + } +/* + part { + name: "icon_bg"; + mouse_events: 0; + description { + min: 48 48; + max: 48 48; + align: 0.5 0.0; + state: "default" 0.0; + rel1 { + to: "icon_swallow"; + offset: 5 5; + } + image { + normal: "e17_fileman_thumb_bg.png"; + } + } + } +*/ + part { + name: "icon_box_shadow"; + mouse_events: 0; + description { + min: 56 56; + max: 56 56; + state: "default" 0.0; + rel1 { + to: "icon_box"; + relative: 0.0 0.0; + offset: 2 2; + } + rel2 { + to: "icon_box"; + relative: 1.0 1.0; + offset: 3 3; + } + image { + normal: "e17_mini_button_shadow2.png"; + border: 6 6 6 6; + } + } + } + part { + name: "icon_box"; + type: RECT; + mouse_events: 0; + description { + min: 52 52; + max: 52 52; + state: "default" 0.0; + rel1 { + to: "icon_swallow"; + relative: 0.0 0.0; + offset: -2 -2; + } + rel2 { + to: "icon_swallow"; + relative: 1.0 1.0; + offset: 2 2; + } + color: 0 0 0 255; + } + } + part { + name: "icon_box_bg"; + mouse_events: 0; + description { + min: 50 50; + max: 50 50; + state: "default" 0.0; + rel1 { + to: "icon_swallow"; + relative: 0.0 0.0; + offset: -1 -1; + } + rel2 { + to: "icon_swallow"; + relative: 1.0 1.0; + offset: 1 1; + } + image { + normal: "e17_fileman_thumb_bg.png"; + } + fill { + smooth: 0; + size { + relative: 0 0; + offset: 32 32; + } + } + } + } + part { + name: "icon_swallow"; + type: SWALLOW; + mouse_events: 0; + description { + min: 48 48; + max: 48 48; + align: 0.5 0.0; + state: "default" 0.0; + } + } + part { + name: "icon_overlay"; + mouse_events: 1; + description { + state: "default" 0.0; + visible: 0; + rel1 { + relative: 0.0 0.0; + offset: -3 -4; + } + rel2 { + relative: 1.0 1.0; + offset: 3 6; + } + image { + normal: "e17_button.png"; + } + color: 255 255 255 128; + } + description { + state: "clicked" 0.0; + inherit: "default" 0.0; + visible: 1; + } + } + part { + name: "icon_title"; + type: SWALLOW; + description { + fixed: 1 1; + align: 0.5 0.0; + state: "default" 0.0; + rel1 { + to: "icon_box"; + relative: 0.0 1.0; + offset: 1 2; + } + rel2 { + to: "icon_box"; + relative: 1.0 1.0; + offset: -1 2; + } + } + description { + state: "clicked" 0.0; + inherit: "default" 0.0; + } + } + part { + name: "icon_event"; + type: RECT; + mouse_events: 1; + description { + state: "default" 0.0; + rel1 { + relative: 0.0 0.0; + offset: -3 -4; + } + rel2 { + relative: 1.0 1.0; + offset: 3 6; + } + color: 0 0 0 0; + } + } +/* + part { + name: "icon_title"; + type: TEXTBLOCK; + effect: NONE; + description { + rel1 { + relative: 0.0 1.0; + offset: 5 -20; + } + rel2 { + relative: 1.0 1.0; + offset: -6 1000; + } + color: 0 0 0 255; + //color3: 0 0 0 32; + text { + text: "No Title"; + style: "fileman_icon_style"; + min: 1 1; + } + } + } +*/ + part { + name: "icon_title_edit_swallow"; + type: SWALLOW; + effect: NONE; + description { + rel1 { + relative: 0.0 1.0; + offset: 5 -20; + } + rel2 { + relative: 1.0 1.0; + offset: -6 -6; + } + } + } + } + programs { + program { + name: "clicked"; + signal: "clicked"; + source: ""; + action: STATE_SET "clicked" 0.0; + target: "icon_title"; + target: "icon_overlay"; + } + program { + name: "unclicked"; + signal: "unclicked"; + source: ""; + action: STATE_SET "default" 0.0; + target: "icon_title"; + target: "icon_overlay"; + } + } +} + group { name: "fileman/icon_list"; // min: 12 12; diff --git a/data/themes/images/Makefile.am b/data/themes/images/Makefile.am index aaa46a346..06edda4cd 100644 --- a/data/themes/images/Makefile.am +++ b/data/themes/images/Makefile.am @@ -331,6 +331,7 @@ e17_scrollbar_vdrag_thumb.png \ e17_fileman_bg.png \ e17_fileman_bg_shadow.png \ e17_fileman_rubberband.png \ +e17_fileman_thumb_bg.png \ e17_icon_fileman_c.png \ e17_icon_fileman_file.png \ e17_icon_fileman_file_clicked.png \ diff --git a/data/themes/images/e17_fileman_thumb_bg.png b/data/themes/images/e17_fileman_thumb_bg.png new file mode 100644 index 0000000000000000000000000000000000000000..4ce387be88d80cdc80f61474d76704bfe7e39e50 GIT binary patch literal 291 zcmeAS@N?&q;$mQ6;PUiv2?EjzAk4uAB#W!6z5pqYhW{YAVDIwDKoQOYkH}&M z25w;xW@MN(M*=9wUgGKN%6^rbnMYgQP>EwHP-vs4i(^Q{;kQ#ZavfFRanWbl?V8lE zX5!ZyTE+(Kr2#5d0h8hzMXECPX^X$tiL`sEdv51-31%fGdYy zFWj3eeXaB_OHz++!94XfTMzF@OVe0-;EaNjKwxv}wWoqH!WW-2pShF31!ULkT=&{n z)A#kB=Tx8i9w%3mrI@l=43GjEYA7OsP__3h^!u_+A az3#+9o?~ZTJwF6=JcFmJpUXO@geCwmZ)-yU literal 0 HcmV?d00001 diff --git a/src/bin/e_fileman_icon.c b/src/bin/e_fileman_icon.c index 925450c4e..8775e51b9 100644 --- a/src/bin/e_fileman_icon.c +++ b/src/bin/e_fileman_icon.c @@ -20,6 +20,7 @@ struct _E_Smart_Data Evas_Object *image_object; Evas_Object *entry_object; Evas_Object *title_object; + Evas_Object *thumb_object; E_Fm_File *file; @@ -131,10 +132,20 @@ e_fm_icon_file_set(Evas_Object *obj, E_Fm_File *file) { sd->thumb_path = e_thumb_file_get(sd->file->path); if (e_thumb_exists(sd->file->path)) - sd->image_object = e_thumb_evas_object_get(sd->file->path, - sd->evas, - sd->iw, - sd->ih); + { + sd->thumb_object = e_thumb_evas_object_get(sd->file->path, + sd->evas, + sd->iw, + sd->ih); + evas_object_smart_member_add(sd->thumb_object, sd->obj); + + sd->image_object = edje_object_add(sd->evas); + edje_extern_object_min_size_set(sd->image_object, sd->iw, sd->ih); + e_theme_edje_object_set(sd->image_object, "base/theme/fileman", + "fileman/icon_thumb"); + edje_object_part_swallow(sd->image_object, "icon_swallow", + sd->thumb_object); + } else { thumb_files = evas_list_append(thumb_files, sd); @@ -307,6 +318,11 @@ _e_fm_icon_smart_del(Evas_Object *obj) evas_object_smart_member_del(sd->title_object); evas_object_del(sd->title_object); } + if (sd->thumb_object) + { + evas_object_smart_member_del(sd->thumb_object); + evas_object_del(sd->thumb_object); + } E_FREE(sd->saved_title); if (sd->file) e_object_unref(E_OBJECT(sd->file)); free(sd); @@ -453,11 +469,23 @@ _e_fm_icon_thumb_cb_exe_exit(void *data, int type, void *event) if ((ext) || (ecore_file_exists(sd->thumb_path))) { if (sd->image_object) evas_object_del(sd->image_object); - sd->image_object = e_thumb_evas_object_get(sd->file->path, + + sd->thumb_object = e_thumb_evas_object_get(sd->file->path, sd->evas, - sd->iw, sd->ih); + sd->iw, + sd->ih); + evas_object_smart_member_add(sd->thumb_object, sd->obj); + + sd->image_object = edje_object_add(sd->evas); + edje_extern_object_min_size_set(sd->image_object, sd->iw, sd->ih); + e_theme_edje_object_set(sd->image_object, "base/theme/fileman", + "fileman/icon_thumb"); + edje_object_part_swallow(sd->image_object, "icon_swallow", + sd->thumb_object); edje_object_part_swallow(sd->icon_object, "icon_swallow", sd->image_object); + edje_object_part_swallow(sd->icon_object, "icon_title", + sd->title_object); } pid = -1; diff --git a/src/bin/e_fileman_smart.c b/src/bin/e_fileman_smart.c index bea010b03..d7696503e 100644 --- a/src/bin/e_fileman_smart.c +++ b/src/bin/e_fileman_smart.c @@ -1858,7 +1858,7 @@ _e_fm_mouse_down_cb(void *data, Evas *e, Evas_Object *obj, void *event_info) "fileman/button/properties"); ecore_evas_geometry_get(sd->win->ecore_evas, &x, &y, &w, &h); - + e_menu_activate_mouse(sd->menu, sd->win->border->zone, ev->output.x + x, ev->output.y + y, 1, 1, E_MENU_POP_DIRECTION_DOWN, ev->timestamp);