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
devs/princeamd/enlightenment-0.17-elive
Viktor Kojouharov 16 years ago
parent 0ac7567560
commit 78a83575db
  1. 9
      src/bin/e_widget_framelist.c
  2. 1
      src/bin/e_widget_framelist.h
  3. 18
      src/bin/e_widget_frametable.c
  4. 2
      src/bin/e_widget_frametable.h
  5. 18
      src/bin/e_widget_image.c

@ -87,6 +87,15 @@ e_widget_framelist_content_align_set(Evas_Object *obj, double halign, double val
e_box_align_set(wd->o_box, halign, valign);
}
EAPI void
e_widget_framelist_label_set(Evas_Object *obj, char *label)
{
E_Widget_Data *wd;
wd = e_widget_data_get(obj);
edje_object_part_text_set(wd->o_frame, "e.text.label", label);
}
static void
_e_wid_del_hook(Evas_Object *obj)

@ -9,6 +9,7 @@
EAPI Evas_Object *e_widget_framelist_add(Evas *evas, char *label, int horiz);
EAPI void e_widget_framelist_object_append(Evas_Object *obj, Evas_Object *sobj);
EAPI void e_widget_framelist_content_align_set(Evas_Object *obj, double halign, double valign);
EAPI void e_widget_framelist_label_set(Evas_Object *obj, char *label);
#endif
#endif

@ -77,6 +77,24 @@ e_widget_frametable_object_append(Evas_Object *obj, Evas_Object *sobj, int col,
evas_object_show(sobj);
}
EAPI void
e_widget_frametable_content_align_set(Evas_Object *obj, double halign, double valign)
{
E_Widget_Data *wd;
wd = e_widget_data_get(obj);
e_table_align_set(wd->o_table, halign, valign);
}
EAPI void
e_widget_frametable_label_set(Evas_Object *obj, char *label)
{
E_Widget_Data *wd;
wd = e_widget_data_get(obj);
edje_object_part_text_set(wd->o_frame, "e.text.label", label);
}
static void
_e_wid_del_hook(Evas_Object *obj)
{

@ -8,6 +8,8 @@
EAPI Evas_Object *e_widget_frametable_add(Evas *evas, char *label, int homogenous);
EAPI void e_widget_frametable_object_append(Evas_Object *obj, Evas_Object *sobj, int col, int row, int colspan, int rowspan, int fill_w, int fill_h, int expand_w, int expand_h);
EAPI void e_widget_frametable_content_align_set(Evas_Object *obj, double halign, double valign);
EAPI void e_widget_frametable_label_set(Evas_Object *obj, char *label);
#endif
#endif

@ -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);
}

Loading…
Cancel
Save