aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/e_widget_image.c
diff options
context:
space:
mode:
authorMike Blumenkrantz <michael.blumenkrantz@gmail.com>2012-07-20 07:52:53 +0000
committerMike Blumenkrantz <michael.blumenkrantz@gmail.com>2012-07-20 07:52:53 +0000
commitd199c589042077a8f7a0436664c274b5808d497c (patch)
tree818e4b0ca2fd92b0d6f53c167d0298f1c7b29132 /src/bin/e_widget_image.c
parentset edje flag in e_icon for edje objects instead of always using strcmp to check (diff)
downloadenlightenment-d199c589042077a8f7a0436664c274b5808d497c.tar.gz
finally kill off the last of the e_icon_object_set uses;
this function was being abused in 100% of cases to do something other than the intended use of just setting an evas image into an e_icon. I've added e_icon_edje_object_set which is the edje version and will, hopefully, make things more clear and avoid confusion in the future e_widget_image now calls the proper e_icon functions and is far less likely to trigger a magic failure SVN revision: 74213
Diffstat (limited to 'src/bin/e_widget_image.c')
-rw-r--r--src/bin/e_widget_image.c29
1 files changed, 8 insertions, 21 deletions
diff --git a/src/bin/e_widget_image.c b/src/bin/e_widget_image.c
index bb57103b4..e626cd077 100644
--- a/src/bin/e_widget_image.c
+++ b/src/bin/e_widget_image.c
@@ -26,7 +26,7 @@ e_widget_image_add_from_object(Evas *evas, Evas_Object *object, int minw, int mi
evas_object_show(object);
o = e_icon_add(evas);
e_icon_fill_inside_set(o, 1);
- e_icon_object_set(o, object);
+ e_icon_edje_object_set(o, object);
wd->img = o;
e_widget_data_set(obj, wd);
e_widget_can_focus_set(obj, 0);
@@ -54,9 +54,13 @@ e_widget_image_add_from_file(Evas *evas, const char *file, int minw, int minh)
o = e_icon_add(evas);
e_icon_fill_inside_set(o, 1);
- o2 = evas_object_image_add(evas);
- evas_object_image_file_set(o2, file, NULL);
- e_icon_object_set(o, o2);
+ if (!e_icon_file_set(o, file))
+ {
+ evas_object_del(o);
+ free(wd);
+ evas_object_del(obj);
+ return NULL;
+ }
wd->img = o;
evas_object_show(o);
@@ -99,23 +103,6 @@ e_widget_image_file_key_set(Evas_Object *obj, const char *file, const char *key)
evas_object_show(wd->img);
}
-EAPI void
-e_widget_image_object_set(Evas_Object *obj, Evas_Object *o)
-{
- E_Widget_Data *wd;
- int mw, mh;
-
- wd = e_widget_data_get(obj);
- e_icon_object_set(wd->img, o);
- edje_object_size_min_get(o, &mw, &mh);
- if (wd->minw || wd->minh)
- e_widget_size_min_set(obj, wd->minw, wd->minh);
- else
- e_widget_size_min_set(obj, mw, mh);
- evas_object_show(wd->img);
-}
-
-
static void
_e_wid_del_hook(Evas_Object *obj)
{