- work on icon thumbs, give them their own theme part.

SVN revision: 18254
This commit is contained in:
codewarrior 2005-11-03 15:26:46 +00:00 committed by codewarrior
parent a8476f0a30
commit 9f6d2b667c
5 changed files with 368 additions and 7 deletions

View File

@ -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;

View File

@ -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 \

Binary file not shown.

View File

@ -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;

View File

@ -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);