- fix icon file names

- fix spacing


SVN revision: 18197
This commit is contained in:
codewarrior 2005-11-02 01:37:11 +00:00 committed by codewarrior
parent 98ebb2936a
commit c0e46ebfe7
5 changed files with 169 additions and 66 deletions

View File

@ -25,15 +25,16 @@ group { \
#define FILEMAN_ICON(TYPE) \ #define FILEMAN_ICON(TYPE) \
group { \ group { \
name: "icons/fileman/"TYPE; \ name: "icons/fileman/"TYPE; \
max: 64 64; \ max: 48 48; \
parts { \ parts { \
part { \ part { \
name: "icon"; \ name: "icon"; \
mouse_events: 0; \ mouse_events: 0; \
description { \ description { \
state: "default" 0.0; \ state: "default" 0.0; \
aspect: 1.0 1.0; \ aspect: 1.0 1.0; \
max: 64 64; \ align: 0.5 0.0; \
max: 48 48; \
image { \ image { \
normal: "e17_icon_fileman_"TYPE".png"; \ normal: "e17_icon_fileman_"TYPE".png"; \
} \ } \
@ -45,23 +46,25 @@ group { \
#define FILEMAN_ICON_CLICKABLE(TYPE) \ #define FILEMAN_ICON_CLICKABLE(TYPE) \
group { \ group { \
name: "icons/fileman/"TYPE; \ name: "icons/fileman/"TYPE; \
max: 64 64; \ max: 48 48; \
parts { \ parts { \
part { \ part { \
name: "icon"; \ name: "icon"; \
mouse_events: 0; \ mouse_events: 0; \
description { \ description { \
state: "default" 0.0; \ state: "default" 0.0; \
align: 0.5 0.0; \
aspect: 1.0 1.0; \ aspect: 1.0 1.0; \
max: 64 64; \ max: 48 48; \
image { \ image { \
normal: "e17_icon_fileman_"TYPE".png"; \ normal: "e17_icon_fileman_"TYPE".png"; \
} \ } \
} \ } \
description { \ description { \
state: "clicked" 0.0; \ state: "clicked" 0.0; \
align: 0.5 0.0; \
aspect: 1.0 1.0; \ aspect: 1.0 1.0; \
max: 64 64; \ max: 48 48; \
image { \ image { \
normal: "e17_icon_fileman_"TYPE"_clicked.png"; \ normal: "e17_icon_fileman_"TYPE"_clicked.png"; \
} \ } \
@ -153,7 +156,7 @@ styles
{ {
style { style {
name: "fileman_icon_style"; name: "fileman_icon_style";
base: "font=Edje-Vera color=#000 style=shadow shadow_color=#cccccc font_size=10 align=center wrap=char"; base: "font=Edje-Vera color=#000 style=shadow shadow_color=#cccccc font_size=10 align=center wrap=char";
tag: "br" "\n"; tag: "br" "\n";
tag: "hilight" "+ font=Edje-Vera-Bold"; tag: "hilight" "+ font=Edje-Vera-Bold";
tag: "invisible" "+ font=Edje-Vera font_size=7 style=none color=#0002"; tag: "invisible" "+ font=Edje-Vera font_size=7 style=none color=#0002";
@ -912,57 +915,50 @@ group {
group { group {
name: "fileman/icon_normal"; name: "fileman/icon_normal";
min: 48 48; min: 48 48;
max: 128 128; max: 128 9999;
parts { parts {
part {
/* this is used for debugging */
name: "ghost";
type: RECT;
description {
state: "default" 0.0;
visible: 0;
color: 128 128 128 128;
}
}
part { part {
name: "icon_swallow"; name: "icon_swallow";
type: SWALLOW; type: SWALLOW;
mouse_events: 0; mouse_events: 0;
description { description {
min: 48 48; min: 48 48;
max: 128 128; max: 48 48;
align: 0.5 0.0;
state: "default" 0.0; state: "default" 0.0;
rel1 {
relative: 0.0 0.0;
offset: 5 5;
}
rel2 {
relative: 1.0 1.0;
offset: -6 -20;
}
color: 0 0 0 255;
} }
} }
part { part {
name: "icon_title"; name: "icon_title";
type: TEXT; type: SWALLOW;
effect: SHADOW;
description { description {
fixed: 1 1;
align: 0.5 0.0;
state: "default" 0.0; state: "default" 0.0;
rel1 { rel1 {
to: "icon_swallow";
relative: 0.0 1.0; relative: 0.0 1.0;
offset: 5 -6; offset: -1 -1;
} }
rel2 { rel2 {
to: "icon_swallow";
relative: 1.0 1.0; relative: 1.0 1.0;
offset: -6 -6; offset: -1 -1;
} }
color: 0 0 0 255;
color3: 255 255 255 128;
text {
text: "No Title";
align: 0.0 0.0;
font: "Edje-Vera";
size: 10;
// min: 1 1;
}
} }
description { description {
state: "clicked" 0.0; state: "clicked" 0.0;
inherit: "default" 0.0; inherit: "default" 0.0;
text {
font: "Edje-Vera-Bold";
}
} }
} }
part { part {
@ -974,12 +970,10 @@ group {
rel1 { rel1 {
relative: 0.0 0.0; relative: 0.0 0.0;
offset: 0 0; offset: 0 0;
//to: "icon_swallow";
} }
rel2 { rel2 {
relative: 1.0 1.0; relative: 1.0 1.0;
offset: -1 -1; offset: -1 -1;
//to: "icon_swallow";
} }
color: 0 0 0 0; color: 0 0 0 0;
} }

View File

@ -7,7 +7,7 @@ typedef struct _E_Smart_Data E_Smart_Data;
struct _E_Smart_Data struct _E_Smart_Data
{ {
Evas_Coord x, y, w, h; Evas_Coord x, y, w, h, iw, ih;
Evas *evas; Evas *evas;
Evas_Object *obj; Evas_Object *obj;
@ -19,6 +19,7 @@ struct _E_Smart_Data
Evas_Object *icon_object; Evas_Object *icon_object;
Evas_Object *image_object; Evas_Object *image_object;
Evas_Object *entry_object; Evas_Object *entry_object;
Evas_Object *title_object;
E_Fm_File *file; E_Fm_File *file;
@ -132,8 +133,8 @@ e_fm_icon_file_set(Evas_Object *obj, E_Fm_File *file)
if (e_thumb_exists(sd->file->path)) if (e_thumb_exists(sd->file->path))
sd->image_object = e_thumb_evas_object_get(sd->file->path, sd->image_object = e_thumb_evas_object_get(sd->file->path,
sd->evas, sd->evas,
sd->w, sd->iw,
sd->h); sd->ih);
else else
{ {
thumb_files = evas_list_append(thumb_files, sd); thumb_files = evas_list_append(thumb_files, sd);
@ -148,23 +149,47 @@ e_fm_icon_file_set(Evas_Object *obj, E_Fm_File *file)
_e_fm_icon_type_set(sd); _e_fm_icon_type_set(sd);
edje_object_size_min_calc(sd->icon_object, &icon_w, &icon_h); //edje_object_size_min_calc(sd->icon_object, &icon_w, &icon_h);
evas_object_resize(sd->icon_object, icon_w, icon_h); //evas_object_resize(sd->icon_object, icon_w, icon_h);
evas_object_resize(sd->event_object, icon_w, icon_h); //evas_object_resize(sd->event_object, icon_w, icon_h);
evas_object_resize(sd->obj, icon_w, icon_h); //evas_object_resize(sd->obj, icon_w, icon_h);
} }
void void
e_fm_icon_title_set(Evas_Object *obj, const char *title) e_fm_icon_title_set(Evas_Object *obj, const char *title)
{ {
E_Smart_Data *sd; E_Smart_Data *sd;
sd = evas_object_smart_data_get(obj); sd = evas_object_smart_data_get(obj);
if (!sd) return; if (!sd) return;
E_FREE(sd->saved_title); E_FREE(sd->saved_title);
sd->saved_title = E_NEW(char, strlen(title) + 1); sd->saved_title = E_NEW(char, strlen(title) + 1);
snprintf(sd->saved_title, strlen(title) + 1, "%s", title); snprintf(sd->saved_title, strlen(title) + 1, "%s", title);
if (sd->icon_object) edje_object_part_text_set(sd->icon_object, "icon_title", title); //if (sd->icon_object) edje_object_part_text_set(sd->icon_object, "icon_title", title);
if(sd->icon_object)
{
Evas_Textblock_Style *e_editable_text_style;
Evas_Coord fw, fh, il, ir, it, ib;
e_editable_text_style = evas_textblock_style_new();
evas_textblock_style_set(e_editable_text_style, "DEFAULT='font=Vera font_size=10 style=shadow shadow_color=#ffffff80 align=center color=#000000 wrap=char'");
evas_object_textblock_style_set(sd->title_object, e_editable_text_style);
evas_object_textblock_text_markup_set(sd->title_object, sd->file->name);
evas_object_resize(sd->title_object, sd->w, 1);
evas_object_textblock_size_formatted_get(sd->title_object, &fw, &fh);
evas_object_textblock_style_insets_get(sd->title_object, &il, &ir, &it, &ib);
sd->h = sd->ih + fh + it + ib;
evas_object_resize(sd->title_object, sd->w, fh + it + ib);
edje_extern_object_min_size_set(sd->title_object, sd->w, fh + it + ib);
evas_object_resize(sd->icon_object, sd->w, sd->h);
evas_object_resize(sd->obj, sd->w, sd->h);
edje_object_part_swallow(sd->icon_object, "icon_title", sd->title_object);
}
} }
void void
@ -206,6 +231,19 @@ e_fm_icon_assoc_set(Evas_Object *obj, const char *assoc)
return 0; return 0;
} }
void
e_fm_icon_image_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
{
E_Smart_Data *sd;
sd = evas_object_smart_data_get(obj);
if (!sd) return;
sd->iw = w;
sd->ih = h;
evas_object_resize(sd->image_object, w, h);
}
/* local subsystem functions */ /* local subsystem functions */
static void static void
_e_fm_icon_smart_add(Evas_Object *obj) _e_fm_icon_smart_add(Evas_Object *obj)
@ -219,12 +257,19 @@ _e_fm_icon_smart_add(Evas_Object *obj)
sd->obj = obj; sd->obj = obj;
sd->saved_title = NULL; sd->saved_title = NULL;
sd->type = E_FM_ICON_NORMAL; sd->type = E_FM_ICON_NORMAL;
sd->w = 64;
sd->h = 64;
sd->iw = 48;
sd->ih = 48;
sd->event_object = evas_object_rectangle_add(sd->evas); sd->event_object = evas_object_rectangle_add(sd->evas);
evas_object_color_set(sd->event_object, 0, 0, 0, 0); evas_object_color_set(sd->event_object, 0, 0, 0, 0);
evas_object_smart_member_add(sd->event_object, obj); evas_object_smart_member_add(sd->event_object, obj);
evas_object_show(sd->event_object); evas_object_show(sd->event_object);
evas_object_smart_data_set(obj, sd); evas_object_smart_data_set(obj, sd);
sd->title_object = evas_object_textblock_add(sd->evas);
evas_object_smart_member_add(sd->title_object, obj);
sd->visible = 1; sd->visible = 1;
sd->icon_object = edje_object_add(sd->evas); sd->icon_object = edje_object_add(sd->evas);
evas_object_smart_member_add(sd->icon_object, obj); evas_object_smart_member_add(sd->icon_object, obj);
@ -257,6 +302,11 @@ _e_fm_icon_smart_del(Evas_Object *obj)
evas_object_smart_member_del(sd->image_object); evas_object_smart_member_del(sd->image_object);
evas_object_del(sd->image_object); evas_object_del(sd->image_object);
} }
if (sd->title_object)
{
evas_object_smart_member_del(sd->title_object);
evas_object_del(sd->title_object);
}
E_FREE(sd->saved_title); E_FREE(sd->saved_title);
if (sd->file) e_object_unref(E_OBJECT(sd->file)); if (sd->file) e_object_unref(E_OBJECT(sd->file));
free(sd); free(sd);
@ -289,10 +339,13 @@ _e_fm_icon_smart_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h)
if(sd->w == w && sd->h == h) return; if(sd->w == w && sd->h == h) return;
evas_object_resize(sd->event_object, w, h);
if (sd->icon_object) evas_object_resize(sd->icon_object, w, h);
sd->w = w; sd->w = w;
sd->h = h; if(sd->h < h)
sd->h = h;
evas_object_resize(sd->event_object, sd->w, sd->h);
if (sd->icon_object) evas_object_resize(sd->icon_object, sd->w, sd->h);
//if (sd->image_object) evas_object_resize(sd->image_object, w, h); //if (sd->image_object) evas_object_resize(sd->image_object, w, h);
} }
@ -402,7 +455,7 @@ _e_fm_icon_thumb_cb_exe_exit(void *data, int type, void *event)
if (sd->image_object) evas_object_del(sd->image_object); if (sd->image_object) evas_object_del(sd->image_object);
sd->image_object = e_thumb_evas_object_get(sd->file->path, sd->image_object = e_thumb_evas_object_get(sd->file->path,
sd->evas, sd->evas,
sd->w, sd->h); sd->iw, sd->ih);
edje_object_part_swallow(sd->icon_object, "icon_swallow", edje_object_part_swallow(sd->icon_object, "icon_swallow",
sd->image_object); sd->image_object);
} }
@ -440,8 +493,52 @@ _e_fm_icon_type_set(E_Smart_Data *sd)
evas_object_show(sd->image_object); evas_object_show(sd->image_object);
} }
if(sd->saved_title) if(sd->saved_title)
edje_object_part_text_set(sd->icon_object, "icon_title", sd->saved_title); {
Evas_Textblock_Style *e_editable_text_style;
Evas_Coord fw, fh, il, ir, it, ib;
e_editable_text_style = evas_textblock_style_new();
evas_textblock_style_set(e_editable_text_style, "DEFAULT='font=Vera font_size=10 align=center color=#000000 wrap=char'");
evas_object_textblock_style_set(sd->title_object, e_editable_text_style);
evas_object_textblock_text_markup_set(sd->title_object, sd->file->name);
evas_object_resize(sd->title_object, sd->w, 1);
evas_object_textblock_size_formatted_get(sd->title_object, &fw, &fh);
evas_object_textblock_style_insets_get(sd->title_object, &il, &ir, &it, &ib);
sd->h = sd->ih + fh + it + ib;
evas_object_resize(sd->title_object, sd->w, fh + it + ib);
edje_extern_object_min_size_set(sd->title_object, sd->w, fh + it + ib);
evas_object_resize(sd->icon_object, sd->w, sd->h);
evas_object_resize(sd->obj, sd->w, sd->h);
edje_object_part_swallow(sd->icon_object, "icon_title", sd->title_object);
}
else else
edje_object_part_text_set(sd->icon_object, "icon_title", sd->file->name); {
Evas_Textblock_Style *e_editable_text_style;
Evas_Coord fw, fh, il, ir, it, ib;
e_editable_text_style = evas_textblock_style_new();
evas_textblock_style_set(e_editable_text_style, "DEFAULT='font=Vera font_size=10 align=center color=#000000 wrap=char'");
evas_object_textblock_style_set(sd->title_object, e_editable_text_style);
evas_object_textblock_text_markup_set(sd->title_object, sd->file->name);
evas_object_resize(sd->title_object, sd->w, 1);
evas_object_textblock_size_formatted_get(sd->title_object, &fw, &fh);
evas_object_textblock_style_insets_get(sd->title_object, &il, &ir, &it, &ib);
sd->h = sd->ih + fh + it + ib;
evas_object_resize(sd->title_object, sd->w, fh + it + ib);
edje_extern_object_min_size_set(sd->title_object, sd->w, fh + it + ib);
evas_object_resize(sd->icon_object, sd->w, sd->h);
evas_object_resize(sd->obj, sd->w, sd->h);
edje_object_part_swallow(sd->icon_object, "icon_title", sd->title_object);
}
} }

View File

@ -23,6 +23,7 @@ EAPI void e_fm_icon_title_set(Evas_Object *obj, const char *title);
EAPI void e_fm_icon_type_set(Evas_Object *obj, int type); EAPI void e_fm_icon_type_set(Evas_Object *obj, int type);
EAPI void e_fm_icon_edit_entry_set(Evas_Object *obj, Evas_Object *entry); EAPI void e_fm_icon_edit_entry_set(Evas_Object *obj, Evas_Object *entry);
EAPI void e_fm_icon_signal_emit(Evas_Object *obj, const char *source, const char *emission); EAPI void e_fm_icon_signal_emit(Evas_Object *obj, const char *source, const char *emission);
EAPI void e_fm_icon_image_resize(Evas_Object *obj, Evas_Coord w, Evas_Coord h);
#endif #endif
#endif #endif

View File

@ -513,8 +513,8 @@ _e_fm_smart_add(Evas_Object *object)
sd->icon_info.w = 48; sd->icon_info.w = 48;
sd->icon_info.h = 48; sd->icon_info.h = 48;
sd->icon_info.x_space = 25; sd->icon_info.x_space = 12;
sd->icon_info.y_space = 25; sd->icon_info.y_space = 10;
sd->evas = evas_object_evas_get(object); sd->evas = evas_object_evas_get(object);
sd->frozen = 0; sd->frozen = 0;
@ -1352,10 +1352,12 @@ _e_fm_dir_set(E_Fm_Smart_Data *sd, const char *dir)
{ {
E_Fm_Icon *icon; E_Fm_Icon *icon;
Evas_Coord icon_w, icon_h; Evas_Coord icon_w, icon_h;
Evas_Coord w, h;
icon = l->data; icon = l->data;
evas_object_resize(icon->icon_object, sd->icon_info.w, sd->icon_info.h); //evas_object_resize(icon->icon_object, sd->icon_info.w, sd->icon_info.h);
e_fm_icon_image_resize(icon->icon_object, sd->icon_info.w, sd->icon_info.h);
evas_object_show(icon->icon_object); evas_object_show(icon->icon_object);
evas_object_geometry_get(icon->icon_object, NULL, NULL, &icon_w, &icon_h); evas_object_geometry_get(icon->icon_object, NULL, NULL, &icon_w, &icon_h);
D(("_e_fm_dir_set: Icon, w=%d h=%d\n", icon_w, icon_h)); D(("_e_fm_dir_set: Icon, w=%d h=%d\n", icon_w, icon_h));
@ -1427,10 +1429,12 @@ _e_fm_dir_files_get(E_Fm_Smart_Data *sd, int type)
} }
else else
{ {
Evas_Coord w, h;
icon->icon_object = e_fm_icon_add(sd->evas); icon->icon_object = e_fm_icon_add(sd->evas);
icon->sd = sd; icon->sd = sd;
e_fm_icon_file_set(icon->icon_object, icon->file); e_fm_icon_file_set(icon->icon_object, icon->file);
evas_object_resize(icon->icon_object, sd->icon_info.w, sd->icon_info.h); e_fm_icon_image_resize(icon->icon_object, sd->icon_info.w, sd->icon_info.h);
files = evas_list_append(files, icon); files = evas_list_append(files, icon);
} }
} }
@ -1479,6 +1483,7 @@ _e_fm_dir_monitor_cb(void *data, Ecore_File_Monitor *ecore_file_monitor,
char *dir; char *dir;
E_Fm_Icon *icon; E_Fm_Icon *icon;
Evas_List *l; Evas_List *l;
Evas_Coord w, h;
sd = data; sd = data;
@ -1502,8 +1507,7 @@ _e_fm_dir_monitor_cb(void *data, Ecore_File_Monitor *ecore_file_monitor,
icon->sd = sd; icon->sd = sd;
e_icon_layout_freeze(sd->layout); e_icon_layout_freeze(sd->layout);
e_fm_icon_file_set(icon->icon_object, icon->file); e_fm_icon_file_set(icon->icon_object, icon->file);
evas_object_resize(icon->icon_object, sd->icon_info.w, sd->icon_info.h); e_fm_icon_image_resize(icon->icon_object, sd->icon_info.w, sd->icon_info.h);
evas_object_resize(icon->icon_object, sd->icon_info.w, sd->icon_info.h);
evas_object_show(icon->icon_object); evas_object_show(icon->icon_object);
e_icon_layout_pack(sd->layout, icon->icon_object); e_icon_layout_pack(sd->layout, icon->icon_object);
evas_object_event_callback_add(icon->icon_object, EVAS_CALLBACK_MOUSE_DOWN, _e_fm_icon_mouse_down_cb, icon); evas_object_event_callback_add(icon->icon_object, EVAS_CALLBACK_MOUSE_DOWN, _e_fm_icon_mouse_down_cb, icon);
@ -2073,7 +2077,6 @@ _e_fm_icon_mouse_in_cb(void *data, Evas *e, Evas_Object *obj, void *event_info)
icon = data; icon = data;
e_fm_icon_signal_emit(icon->icon_object, "hilight", ""); e_fm_icon_signal_emit(icon->icon_object, "hilight", "");
} }
static void static void

View File

@ -308,7 +308,7 @@ _e_icon_layout_smart_item_del_hook(void *data, Evas *e, Evas_Object *obj, void *
static void static void
_e_icon_layout_smart_reconfigure(E_Smart_Data *sd) _e_icon_layout_smart_reconfigure(E_Smart_Data *sd)
{ {
Evas_Coord x, y, w, h; Evas_Coord x, y, w, h, maxw, maxh;
Evas_List *l; Evas_List *l;
//if (!sd->changed) return; //if (!sd->changed) return;
@ -317,6 +317,8 @@ _e_icon_layout_smart_reconfigure(E_Smart_Data *sd)
y = sd->y + sd->ys; y = sd->y + sd->ys;
w = sd->vw; w = sd->vw;
h = sd->vh; h = sd->vh;
maxw = 0;
maxh = 0;
if (sd->fixed == 0) if (sd->fixed == 0)
{ {
@ -327,11 +329,14 @@ _e_icon_layout_smart_reconfigure(E_Smart_Data *sd)
obj = l->data; obj = l->data;
li = evas_object_data_get(obj, "e_icon_layout_data"); li = evas_object_data_get(obj, "e_icon_layout_data");
if(li->h > maxh) maxh = li->h;
if(x > sd->x + w || x + li->w > sd->x + w) if(x > sd->x + w || x + li->w > sd->x + w)
{ {
x = sd->x + sd->xs; x = sd->x + sd->xs;
y += li->h + sd->ys; y += maxh + sd->ys;
maxh = 0;
} }
li->x = x; li->x = x;
@ -355,10 +360,13 @@ _e_icon_layout_smart_reconfigure(E_Smart_Data *sd)
obj = l->data; obj = l->data;
li = evas_object_data_get(obj, "e_icon_layout_data"); li = evas_object_data_get(obj, "e_icon_layout_data");
if(li->w > maxw) maxw = li->w;
if(y > sd->y + h || y + li->h > sd->y + h) if(y > sd->y + h || y + li->h > sd->y + h)
{ {
y = sd->y + sd->ys; y = sd->y + sd->ys;
x += li->w + sd->xs; x += maxw + sd->xs;
maxw = 0;
} }
li->x = x; li->x = x;