static bool _update_recent_info(Evas_Object *base, app_media_info *info)
{
- Evas_Object *image, *text_bg;
+ Evas_Object *img, *img_bg, *text_bg;
struct color_data bg;
struct tm tm;
char buf[32];
- image = elm_object_part_content_get(base,
+ img = elm_object_part_content_get(base,
PART_RECENT_CONTENT_THUMBNAIL);
- if (!image) {
- _ERR("failed to get image object");
+ img_bg = elm_object_part_content_get(base,
+ PART_RECENT_CONTENT_IMGBG);
+
+ if (!img || !img_bg) {
+ _ERR("failed to get object");
return false;
}
+ if (info->thumbnail_path) {
+ elm_image_file_set(img, info->thumbnail_path, NULL);
+ elm_image_aspect_fixed_set(img, EINA_FALSE);
+
+ evas_object_color_set(img_bg, 0, 0, 0, 0);
+ } else
+ evas_object_color_set(img_bg, 0, 0, 0, 255);
+
text_bg = elm_object_part_content_get(base, PART_RECENT_CONTENT_TEXTBG);
if (!text_bg) {
_ERR("failed to get textbg part");
return false;
}
- elm_image_file_set(image, info->thumbnail_path, NULL);
- elm_image_aspect_fixed_set(image, EINA_FALSE);
-
app_contents_get_color(info->title, NULL, &bg);
evas_object_color_set(text_bg, bg.r, bg.g, bg.b, bg.a);
static bool _draw_recent_content(struct _priv *priv, Evas_Object *base)
{
- Evas_Object *btn, *image, *text_bg;
+ Evas_Object *btn, *image, *img_bg, *text_bg;
struct progressbar *prog;
btn = elm_button_add(base);
return false;
}
+ img_bg = evas_object_rectangle_add(btn);
+ if (!img_bg) {
+ _ERR("failed to create rectangle object");
+ return false;
+ }
+
text_bg = evas_object_rectangle_add(btn);
if (!text_bg) {
_ERR("failed to create rectangle object");
}
elm_object_part_content_set(btn, PART_RECENT_CONTENT_THUMBNAIL, image);
+ elm_object_part_content_set(btn, PART_RECENT_CONTENT_IMGBG, img_bg);
elm_object_part_content_set(btn, PART_RECENT_CONTENT_TEXTBG, text_bg);
elm_object_part_content_set(base, PART_ITEM_CONTENT, btn);