#define MESSAGE_NO_CONTENTS "No Contents"
#define PADDING_BOX 26
+#define IMAGE_MAX_SIZE 100
enum input_handler_type {
INPUT_HANDLER_TYPE_EO,
elm_object_part_content_set(eo, part, rect);
}
+static Evas_Object *_set_thumb(Evas_Object *eo, const char *file,
+ const char *part)
+{
+ Evas_Object *image;
+ int w, h;
+
+ image = elm_image_add(eo);
+ if (!image) {
+ _ERR("failed to add image");
+ return NULL;
+ }
+
+ if (!elm_image_file_set(image, file, NULL)) {
+ if (!elm_image_file_set(image, IMAGE_RECENT_THUMB_APP, NULL)) {
+ _ERR("failed to set image file");
+ evas_object_del(image);
+ return NULL;
+ }
+ }
+ elm_image_object_size_get(image, &w, &h);
+ if (w < IMAGE_MAX_SIZE && h < IMAGE_MAX_SIZE)
+ elm_image_resizable_set(image, EINA_FALSE, EINA_FALSE);
+ else
+ elm_image_fill_outside_set(image, EINA_TRUE);
+
+ elm_object_part_content_set(eo, part, image);
+
+ return image;
+}
+
static struct _bar_item *_pack_item(struct _priv *priv, Evas_Object *box,
struct datamgr_item *di)
{
}
if (di->icon) {
- thumb = utils_add_icon(eo, di->icon, PART_RECENT_THUMBNAIL);
+ thumb = _set_thumb(eo, di->icon, PART_RECENT_THUMBNAIL);
if (!thumb) {
_ERR("failed to add thumb");
- thumb = utils_add_icon(eo, IMAGE_RECENT_THUMB_APP,
- PART_RECENT_THUMBNAIL);
- if (!thumb) {
- evas_object_del(eo);
- free(bi);
- return NULL;
- }
+ evas_object_del(eo);
+ free(bi);
+ return NULL;
}
}