* use hd & cdrom icons from the e theme (can use more in future)

* add a tag overlay to the icon (to show ext3, fat, dvd...)
 * simplify the on-over animation of the icons


SVN revision: 38773
This commit is contained in:
Davide Andreoli 2009-01-25 05:26:29 +00:00
parent 7c241eb174
commit 582f2d9420
7 changed files with 80 additions and 55 deletions

View File

@ -17,16 +17,15 @@ files_DATA = module.desktop \
EXTRA_DIST = $(files_DATA) \ EXTRA_DIST = $(files_DATA) \
images/eject.png \ images/eject.png \
images/eject_bg.png \ images/eject_bg.png \
images/icon_cdrom.png \
images/icon_dvd.png \ images/icon_dvd.png \
images/icon_ext3.png \
images/icon_hdd.png \ images/icon_hdd.png \
images/icon_hfs.png \
images/icon_ipod.png \ images/icon_ipod.png \
images/icon_ms.png \ images/icon_ms.png \
images/icon_sdmmc.png \ images/icon_sdmmc.png \
images/icon_vfat.png \ images/icon_psp.png \
images/icon_psp.png images/tag_ext3.png \
images/tag_fat.png \
images/tag_hfs.png
ACLOCAL_AMFLAGS = -I m4 ACLOCAL_AMFLAGS = -I m4

View File

@ -4,15 +4,14 @@ images
image: "eject.png" COMP; image: "eject.png" COMP;
image: "eject_bg.png" COMP; image: "eject_bg.png" COMP;
image: "icon_hdd.png" COMP; image: "icon_hdd.png" COMP;
image: "icon_cdrom.png" COMP;
image: "icon_dvd.png" COMP; image: "icon_dvd.png" COMP;
image: "icon_ipod.png" COMP; image: "icon_ipod.png" COMP;
image: "icon_sdmmc.png" COMP; image: "icon_sdmmc.png" COMP;
image: "icon_ms.png" COMP; image: "icon_ms.png" COMP;
image: "icon_ext3.png" COMP;
image: "icon_vfat.png" COMP;
image: "icon_hfs.png" COMP;
image: "icon_psp.png" COMP; image: "icon_psp.png" COMP;
image: "tag_ext3.png" COMP;
image: "tag_fat.png" COMP;
image: "tag_hfs.png" COMP;
} }
#define ICONS(_name) \ #define ICONS(_name) \
@ -62,13 +61,9 @@ collections
} }
} }
} }
ICONS("cdrom");
ICONS("dvd"); ICONS("dvd");
ICONS("ipod"); ICONS("ipod");
ICONS("sdmmc"); ICONS("sdmmc");
ICONS("ext3");
ICONS("hfs");
ICONS("vfat");
ICONS("ms"); ICONS("ms");
ICONS("psp"); ICONS("psp");
/****************************************************/ /****************************************************/
@ -136,43 +131,57 @@ collections
part { name: "icon"; part { name: "icon";
mouse_events: 0; mouse_events: 0;
type: SWALLOW; type: SWALLOW;
clip_to: "icon_clip";
description { state: "default" 0.0; description { state: "default" 0.0;
rel1.relative: 0 0;
rel2.relative: 0 0; rel2.relative: 0 0;
rel1.offset: 5 5; rel1.offset: 5 5;
rel2.offset: 45 45; rel2.offset: 45 45;
} }
} description { state: "big" 0.0;
part { name: "icon_ghost_clip"; color: 255 255 255 0;
mouse_events: 0;
type: RECT;
description { state: "default" 0.0;
rel1.relative: 0 0;
rel2.relative: 0 0; rel2.relative: 0 0;
rel1.offset: -10 -10; rel1.offset: -10 -10;
rel2.offset: 60 60; rel2.offset: 60 60;
color: 255 255 255 200; }
}
part { name: "icon_clip";
mouse_events: 0;
type: RECT;
description { state: "default" 0.0;
rel2.relative: 0 0;
rel1.offset: -10 -10;
rel2.offset: 60 60;
color: 255 255 255 255;
} }
description { state: "big" 0.0; description { state: "big" 0.0;
inherit: "default" 0.0; inherit: "default" 0.0;
color: 255 255 255 0; color: 255 255 255 0;
} }
} }
part { name: "icon_ghost"; part { name: "icon_tag";
mouse_events: 0; mouse_events: 0;
type: SWALLOW; clip_to: "icon_clip";
clip_to: "icon_ghost_clip";
description { state: "default" 0.0; description { state: "default" 0.0;
rel1.relative: 0 0; image.normal: "tag_ext3.png";
rel2.relative: 0 0; rel1.to: "icon";
rel1.offset: 5 5; rel2.relative: 0.5 0.5;
rel2.offset: 45 45; rel2.to: "icon";
color: 255 255 255 0;
} }
description { state: "big" 0.0; description { state: "ext3" 0.0;
rel1.relative: 0 0; image.normal: "tag_ext3.png";
rel2.relative: 0 0; inherit: "default" 0.0;
rel1.offset: -10 -10; color: 255 255 255 240;
rel2.offset: 60 60; }
description { state: "fat" 0.0;
image.normal: "tag_fat.png";
inherit: "default" 0.0;
color: 255 255 255 240;
}
description { state: "hfs" 0.0;
image.normal: "tag_hfs.png";
inherit: "default" 0.0;
color: 255 255 255 240;
} }
} }
part { name: "gauge_bg"; part { name: "gauge_bg";
@ -368,8 +377,8 @@ collections
source: "icon_events"; source: "icon_events";
action: STATE_SET "big" 0.0; action: STATE_SET "big" 0.0;
transition: DECELERATE 0.5; transition: DECELERATE 0.5;
target: "icon_ghost_clip"; target: "icon_clip";
target: "icon_ghost"; target: "icon";
after: "reset_pulse"; after: "reset_pulse";
after: "pulse"; after: "pulse";
} }
@ -383,8 +392,8 @@ collections
program { name: "reset_pulse"; program { name: "reset_pulse";
action: STATE_SET "default" 0.0; action: STATE_SET "default" 0.0;
transition: LINEAR 0.0; transition: LINEAR 0.0;
target: "icon_ghost_clip"; target: "icon_clip";
target: "icon_ghost"; target: "icon";
} }
program { name: "eject_mouse_in"; program { name: "eject_mouse_in";
signal: "mouse,in"; signal: "mouse,in";
@ -436,6 +445,30 @@ collections
action: STATE_SET "visible" 0.0; action: STATE_SET "visible" 0.0;
target: "eject_icon"; target: "eject_icon";
} }
program { name: "set_tag_none";
signal: "icon,tag,none";
source: "places";
action: STATE_SET "default" 0.0;
target: "icon_tag";
}
program { name: "set_tag_ext3";
signal: "icon,tag,ext3";
source: "places";
action: STATE_SET "ext3" 0.0;
target: "icon_tag";
}
program { name: "set_tag_fat";
signal: "icon,tag,fat";
source: "places";
action: STATE_SET "fat" 0.0;
target: "icon_tag";
}
program { name: "set_tag_hfs";
signal: "icon,tag,hfs";
source: "places";
action: STATE_SET "hfs" 0.0;
target: "icon_tag";
}
program { name: "set_separator_horiz"; program { name: "set_separator_horiz";
signal: "separator,set,horiz"; signal: "separator,set,horiz";
source: "places"; source: "places";

Binary file not shown.

Before

Width:  |  Height:  |  Size: 4.5 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.6 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 5.7 KiB

Binary file not shown.

Before

Width:  |  Height:  |  Size: 6.0 KiB

View File

@ -172,13 +172,13 @@ places_fill_box(Evas_Object *box)
_places_update_size(o, vol); _places_update_size(o, vol);
//choose icon //choose icon
vol->icon = "modules/places/icon/generic"; vol->icon = "e/icons/drive-harddisk";
if (!strcmp(vol->drive_type, "cdrom")) if (!strcmp(vol->drive_type, "cdrom"))
{ {
if (!strcmp(vol->fstype, "udf")) if (!strcmp(vol->fstype, "udf"))
vol->icon = "modules/places/icon/dvd"; vol->icon = "modules/places/icon/dvd";
else else
vol->icon = "modules/places/icon/cdrom"; vol->icon = "e/icons/drive-optical";
} }
else if (!strcmp(vol->model, "\"PSP\" MS")) else if (!strcmp(vol->model, "\"PSP\" MS"))
vol->icon = "modules/places/icon/psp"; vol->icon = "modules/places/icon/psp";
@ -189,22 +189,22 @@ places_fill_box(Evas_Object *box)
else if (!strcmp(vol->model, "iPod")) else if (!strcmp(vol->model, "iPod"))
vol->icon = "modules/places/icon/ipod"; vol->icon = "modules/places/icon/ipod";
else if (!strcmp(vol->fstype, "ext3")) else if (!strcmp(vol->fstype, "ext3"))
vol->icon = "modules/places/icon/ext3"; edje_object_signal_emit(o, "icon,tag,ext3", "places");
else if (!strcmp(vol->fstype, "vfat") || !strcmp(vol->fstype, "ntfs")) else if (!strcmp(vol->fstype, "vfat") || !strcmp(vol->fstype, "ntfs"))
vol->icon = "modules/places/icon/vfat"; edje_object_signal_emit(o, "icon,tag,fat", "places");
else if (!strcmp(vol->fstype, "hfs") || !strcmp(vol->fstype, "hfsplus")) else if (!strcmp(vol->fstype, "hfs") || !strcmp(vol->fstype, "hfsplus"))
vol->icon = "modules/places/icon/hfs"; edje_object_signal_emit(o, "icon,tag,hfs", "places");
//set icon //set icon
icon = edje_object_add(evas_object_evas_get(box)); icon = edje_object_add(evas_object_evas_get(box));
edje_object_file_set(icon, theme_file, vol->icon); if (strncmp(vol->icon, "e/", 2))
edje_object_file_set(icon, theme_file, vol->icon);
else
edje_object_file_set(icon,
e_theme_edje_file_get("base/theme/fileman",
vol->icon), vol->icon);
edje_object_part_swallow(o, "icon", icon); edje_object_part_swallow(o, "icon", icon);
//set ghost icon
icon = edje_object_add(evas_object_evas_get(box));
edje_object_file_set(icon, theme_file, vol->icon);
edje_object_part_swallow(o, "icon_ghost", icon);
//set mount/eject icon //set mount/eject icon
if (vol->requires_eject || (vol->mounted && strcmp(vol->mount_point, "/")) || if (vol->requires_eject || (vol->mounted && strcmp(vol->mount_point, "/")) ||
!strcmp(vol->bus, "usb")) //Some usb key don't have requires_eject set (probably an hal error) !strcmp(vol->bus, "usb")) //Some usb key don't have requires_eject set (probably an hal error)
@ -212,7 +212,6 @@ places_fill_box(Evas_Object *box)
else else
edje_object_signal_emit(o, "icon,eject,hide", "places"); edje_object_signal_emit(o, "icon,eject,hide", "places");
/* orient the separator*/ /* orient the separator*/
if (!e_box_orientation_get(box)) if (!e_box_orientation_get(box))
edje_object_signal_emit(o, "separator,set,horiz", "places"); edje_object_signal_emit(o, "separator,set,horiz", "places");
@ -256,12 +255,6 @@ places_empty_box(Evas_Object *box)
Evas_Object *swal; Evas_Object *swal;
o = e_box_pack_object_nth(box, count); o = e_box_pack_object_nth(box, count);
swal = edje_object_part_swallow_get(o, "icon_ghost");
if (swal)
{
edje_object_part_unswallow(o, swal);
evas_object_del(swal);
}
swal = edje_object_part_swallow_get(o, "icon"); swal = edje_object_part_swallow_get(o, "icon");
if (swal) if (swal)
{ {