aboutsummaryrefslogtreecommitdiffstats
path: root/src/bin/e_widget_image.c
diff options
context:
space:
mode:
authorViktor Kojouharov <vkojouharov@gmail.com>2007-02-21 03:55:18 +0000
committerViktor Kojouharov <vkojouharov@gmail.com>2007-02-21 03:55:18 +0000
commit78a83575db038b10950d47edea463de822657fdf (patch)
tree9aceef957834200b06c19486740fa25c954ec8eb /src/bin/e_widget_image.c
parentFetch the border name(s) once and reuse them. (diff)
downloadenlightenment-78a83575db038b10950d47edea463de822657fdf.tar.gz
e_widget_image will use the min group size of the edje being added, if no min width or height are given. a few helpful functions for e_widget_frame*
SVN revision: 28414
Diffstat (limited to 'src/bin/e_widget_image.c')
-rw-r--r--src/bin/e_widget_image.c18
1 files changed, 16 insertions, 2 deletions
diff --git a/src/bin/e_widget_image.c b/src/bin/e_widget_image.c
index b76250863..def6d4eca 100644
--- a/src/bin/e_widget_image.c
+++ b/src/bin/e_widget_image.c
@@ -7,6 +7,7 @@ typedef struct _E_Widget_Data E_Widget_Data;
struct _E_Widget_Data
{
Evas_Object *img;
+ int minw, minh;
};
static void _e_wid_del_hook(Evas_Object *obj);
@@ -19,6 +20,7 @@ e_widget_image_add_from_object(Evas *evas, Evas_Object *object, int minw, int mi
{
Evas_Object *obj, *o;
E_Widget_Data *wd;
+ int mw = 0, mh = 0;
obj = e_widget_add(evas);
e_widget_del_hook_set(obj, _e_wid_del_hook);
@@ -29,9 +31,15 @@ e_widget_image_add_from_object(Evas *evas, Evas_Object *object, int minw, int mi
e_icon_fill_inside_set(o, 1);
e_icon_object_set(o, object);
wd->img = o;
- e_widget_data_set(obj, wd);
+ e_widget_data_set(obj, wd);
e_widget_can_focus_set(obj, 0);
- e_widget_min_size_set(obj, minw, minh);
+ wd->minw = minw <= 0 ? minw : 0;
+ wd->minh = minh <= 0 ? minh : 0;
+ edje_object_size_min_get(object, &mw, &mh);
+ if (minw || minh)
+ e_widget_min_size_set(obj, minw, minh);
+ else
+ e_widget_min_size_set(obj, mw, mh);
e_widget_sub_object_add(obj, o);
e_widget_resize_object_set(obj, o);
@@ -98,9 +106,15 @@ 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_min_size_set(obj, wd->minw, wd->minh);
+ else
+ e_widget_min_size_set(obj, mw, mh);
evas_object_show(wd->img);
}