movie: set default thumbnail bg color for recently watched item 55/53955/2 accepted/tizen/tv/20151210.231052 submit/tizen/20151210.111053
authorJehun Lim <jehun.lim@samsung.com>
Thu, 10 Dec 2015 10:16:24 +0000 (19:16 +0900)
committerJehun Lim <jehun.lim@samsung.com>
Thu, 10 Dec 2015 10:17:30 +0000 (19:17 +0900)
Change-Id: I3e6ba7f5e81b454f7e5f2c8b470772bcf83e5843
Signed-off-by: Jehun Lim <jehun.lim@samsung.com>
include/layout/movie.h
res/edc/widgets/button.edc
src/layout/movie.c

index 2de9449..7feba61 100644 (file)
@@ -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"
index dbeb890..c9a2648 100644 (file)
@@ -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;
index 59a6249..efefa0c 100644 (file)
@@ -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);