[Enjoy] Theme: Effenihtize album list.

SVN revision: 52951
This commit is contained in:
Leandro Pereira 2010-10-01 16:35:06 +00:00
parent 189bfa01c0
commit ad037bcad4
4 changed files with 102 additions and 33 deletions

View File

@ -19,7 +19,8 @@ images/bt-next.png \
images/bt-next2.png \
images/bt-play.png \
images/bt-pause.png \
images/list-highlight.png
images/list-highlight.png \
images/no-cover.png
fonts =

View File

@ -1,4 +1,20 @@
collections {
group {
name: "album-without-cover";
images {
image: "no-cover.png" COMP;
}
parts {
part {
name: "icon";
type: IMAGE;
description {
state: "default" 0.0;
image.normal: "no-cover.png";
}
}
}
}
group { /*
* TODO: make a proper theme, see TODO and src/bin/win.c
*
@ -1188,8 +1204,6 @@ collections {
}
}
/* TODO: programs in MACRO */
group { name: "elm/genlist/item_compress/root/default";
alias: "elm/genlist/item_compress/nameid/default";
alias: "elm/genlist/item_compress/all-song/default";
@ -1293,7 +1307,6 @@ collections {
}
}
/* TODO: Add a background color for odd items*/
group { name: "elm/genlist/item_compress/album/default";
alias: "elm/genlist/item_compress_odd/album/default";
data {
@ -1334,15 +1347,15 @@ collections {
mouse_events: 0;
description {
state: "default" 0.0;
min: 32 32;
max: 32 32;
min: 68 68;
max: 68 68;
rel1 {
relative: 0.0 0.0;
offset: 4 0;
}
rel2 {
relative: 0.0 1.0;
offset: 35 -1;
offset: 70 -1;
}
}
}
@ -1357,7 +1370,7 @@ collections {
color: 0 0 0 255;
rel1 {
relative: 0.0 0.0;
offset: 40 2;
offset: 75 2;
}
rel2 {
relative: 1.0 1.0;
@ -1439,8 +1452,18 @@ collections {
type: IMAGE;
description {
state: "default" 0.0;
align: 0.0 0.0;
visible: 0;
image.normal: "list-highlight.png";
rel1 {
to_x: "ejy.swallow.cover";
relative: 1.0 0.0;
offset: 3 14;
}
rel2 {
relative: 1.0 1.0;
offset: -1 -10;
}
}
description {
state: "selected" 0.0;
@ -1448,21 +1471,43 @@ collections {
visible: 1;
}
}
part {
name: "cover.bg";
type: RECT;
mouse_events: 0;
description {
state: "default" 0.0;
rel1 {
to: "ejy.swallow.cover";
relative: 0.0 0.0;
offset: -1 -1;
}
rel2 {
to: "ejy.swallow.cover";
relative: 1.0 1.0;
offset: 0 0;
}
color: 66 66 66 255;
}
}
part {
name: "ejy.swallow.cover";
type: SWALLOW;
mouse_events: 0;
description {
state: "default" 0.0;
min: 32 32;
max: 32 32;
min: 68 68;
max: 68 68;
align: 0.0 0.0;
rel1 {
to_y: "bg";
relative: 0.0 0.0;
offset: 4 0;
offset: 27 -6;
}
rel2 {
to_y: "bg";
relative: 0.0 1.0;
offset: 35 -1;
offset: 95 -1;
}
}
}
@ -1474,27 +1519,29 @@ collections {
description {
state: "default" 0.0;
color: 0 0 0 255;
align: 0.0 0.0;
rel1 {
relative: 0.0 0.0;
offset: 40 2;
to_y: "bg";
to_x: "ejy.swallow.cover";
relative: 1.0 0.0;
offset: 21 10;
}
rel2 {
relative: 1.0 0.0;
offset: -5 -2;
to_y: "ejy.text.artist";
to_y: "bg";
relative: 1.0 1.0;
offset: -5 -1;
}
color: 255 255 255 255;
color: 210 210 210 255;
text {
font: "Sans:style=Bold";
size: 12;
size: 8;
min: 0 1;
align: 0.0 0.5;
align: 0.0 0.0;
}
}
description {
state: "selected" 0.0;
inherit: "default" 0.0;
color: 200 20 20 255;
}
}
part {
@ -1504,22 +1551,25 @@ collections {
description {
state: "default" 0.0;
color: 128 128 128 255;
align: 0.0 1.0;
align: 0.0 0.0;
fixed: 1 1;
rel1 {
relative: 0.0 1.0;
offset: 40 -3;
to_y: "bg";
to_x: "ejy.swallow.cover";
relative: 1.0 0.0;
offset: 21 30;
}
rel2 {
to_y: "bg";
relative: 1.0 1.0;
offset: -5 -3;
offset: -5 -1;
}
color: 255 255 255 255;
color: 112 112 112 255;
text {
font: "Sans";
size: 8;
min: 0 1;
align: 0.0 1.0;
align: 0.0 0.0;
text: "";
}
}
@ -2047,5 +2097,4 @@ group { name: "elm/scroller/base/enjoy";
}
}
}
}

Binary file not shown.

After

Width:  |  Height:  |  Size: 4.3 KiB

View File

@ -103,6 +103,27 @@ _cover_album_local_find(Evas *evas, DB *db, Album *album)
}
}
static Evas_Object *
_cover_empty_add(Evas_Object *parent, unsigned short size)
{
Evas_Object *cover = elm_icon_add(parent);
elm_icon_smooth_set(cover, size >= 32);
elm_icon_prescale_set(cover, size);
return cover;
}
static Evas_Object *
_cover_without_image_add(Evas_Object *parent, unsigned short size)
{
Evas_Object *cover = _cover_empty_add(parent, size);
if (!elm_icon_file_set(cover, PACKAGE_DATA_DIR "/default.edj", "album-without-cover"))
{
evas_object_del(cover);
return NULL;
}
return cover;
}
Evas_Object *
cover_album_fetch(Evas_Object *parent, DB *db, Album *album, unsigned short size)
{
@ -137,11 +158,9 @@ cover_album_fetch(Evas_Object *parent, DB *db, Album *album, unsigned short size
}
}
if (!best_match) return NULL;
if (!best_match) return _cover_without_image_add(parent, size);
cover = elm_icon_add(parent);
elm_icon_smooth_set(cover, size >= 32);
elm_icon_prescale_set(cover, size);
cover = _cover_empty_add(parent, size);
if (!elm_icon_file_set(cover, best_match->path, NULL))
{
while (album->covers)
@ -153,7 +172,7 @@ cover_album_fetch(Evas_Object *parent, DB *db, Album *album, unsigned short size
db_album_covers_update(db, album);
evas_object_del(cover);
if (fetches < 2) goto fetch_local;
else return NULL;
else return _cover_without_image_add(parent, size);
}
return cover;