#define ITEM_MOVIE_X (378 + 26)
#define ITEM_MOVIE_Y (294 + 26)
+/* It is temporarily used. */
+#define COUNT_COLOR 5
+
+struct color {
+ int r;
+ int g;
+ int b;
+ int a;
+};
+
+static struct color colors[] =
+{
+ {73, 68, 62, 255},
+ {55, 74, 97, 255},
+ {75, 102, 163, 255},
+ {55, 143, 162, 255},
+ {86, 98, 113, 255}
+};
+
static char *_text_get(void *data, Evas_Object *obj, const char *part)
{
app_media *am;
static Evas_Object *_content_get(void *data, Evas_Object *obj, const char *part)
{
app_media *am;
- Evas_Object *icon, *img;
+ Evas_Object *icon, *img, *text_bg;
char *thumbnail;
+ int idx;
if (!data || !obj) {
_ERR("Invalid argument.");
}
am = data;
- thumbnail = get_media_thumbnail(am);
+ if (!strcmp(part, PART_THUMB_ICON)) {
+ thumbnail = get_media_thumbnail(am);
+
+ if (!thumbnail) {
+ icon = elm_icon_add(obj);
+ if (!icon) {
+ _ERR("elm_icon_add failed.");
+ return NULL;
+ }
+
+ elm_icon_thumb_set(icon, get_media_path(am), NULL);
+ elm_image_aspect_fixed_set(icon, EINA_FALSE);
+
+ return icon;
+ }
+
+ img = elm_image_add(obj);
+ if (!img) {
+ _ERR("elm_image_add failed.");
+ return NULL;
+ }
- if (!thumbnail) {
- icon = elm_icon_add(obj);
- if (!icon) {
- _ERR("elm_icon_add failed.");
+ elm_image_file_set(img, thumbnail, NULL);
+ elm_image_aspect_fixed_set(img, EINA_FALSE);
+ evas_object_show(img);
+
+ return img;
+ } else if (!strcmp(part, PART_THUMB_TEXT_BG)) {
+ text_bg = evas_object_rectangle_add(obj);
+ if (!text_bg) {
+ _ERR("evas_object_rectangle_add failed.");
return NULL;
}
- elm_icon_thumb_set(icon, get_media_path(am), NULL);
- elm_image_aspect_fixed_set(icon, EINA_FALSE);
+ idx = rand() % COUNT_COLOR;
- return icon;
- }
+ evas_object_color_set(text_bg, colors[idx].r, colors[idx].g,
+ colors[idx].b, colors[idx].a);
- img = elm_image_add(obj);
- if (!img) {
- _ERR("elm_image_add failed.");
- return NULL;
- }
+ evas_object_show(text_bg);
- elm_image_file_set(img, thumbnail, NULL);
- elm_image_aspect_fixed_set(img, EINA_FALSE);
- evas_object_show(img);
+ return text_bg;
+ }
- return img;
+ return NULL;
}
static struct grid_class _gclass = {