summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--include/layout/movie.h1
-rw-r--r--res/edc/widgets/button.edc10
-rw-r--r--src/layout/movie.c31
3 files changed, 34 insertions, 8 deletions
diff --git a/include/layout/movie.h b/include/layout/movie.h
index 2de9449..7feba61 100644
--- a/include/layout/movie.h
+++ b/include/layout/movie.h
@@ -28,6 +28,7 @@
#define PART_CONTENT "part.content"
#define PART_NOCONTENT "part.nocontent"
#define PART_RECENT_CONTENT_TEXTBG "part.recent_content_textbg"
+#define PART_RECENT_CONTENT_IMGBG "part.recent_content_imgbg"
#define PART_RECENT_CONTENT_THUMBNAIL "part.recent_content_thumbnail"
#define PART_RECENT_CONTENT_FAVORITE "part.recent_content_favorite"
#define PART_RECENT_CONTENT_TITLE "part.recent_content_title"
diff --git a/res/edc/widgets/button.edc b/res/edc/widgets/button.edc
index dbeb890..c9a2648 100644
--- a/res/edc/widgets/button.edc
+++ b/res/edc/widgets/button.edc
@@ -2001,6 +2001,16 @@ group {
}
}
part {
+ name: PART_RECENT_CONTENT_IMGBG;
+ type: SWALLOW;
+ scale: 1;
+ description {
+ state: "default" 0.0;
+ rel1.to: PART_RECENT_CONTENT_THUMBNAIL;
+ rel2.to: PART_RECENT_CONTENT_THUMBNAIL;
+ }
+ }
+ part {
name: "default_image";
type: IMAGE;
scale: 1;
diff --git a/src/layout/movie.c b/src/layout/movie.c
index 59a6249..efefa0c 100644
--- a/src/layout/movie.c
+++ b/src/layout/movie.c
@@ -71,27 +71,35 @@ struct _priv {
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);
@@ -170,7 +178,7 @@ static bool _draw_recent_title(Evas_Object *base)
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);
@@ -187,6 +195,12 @@ static bool _draw_recent_content(struct _priv *priv, Evas_Object *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");
@@ -194,6 +208,7 @@ static bool _draw_recent_content(struct _priv *priv, Evas_Object *base)
}
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);