forked from enlightenment/efl
Elm label: set the size hint min of the content to the size of the content. Then the frame size hint min of the frame will be update. This is not easy to understand but in some special cases the content of the frame was bigger than the frame.
SVN revision: 43214
This commit is contained in:
parent
97f0feec59
commit
756639fecd
|
@ -60,6 +60,15 @@ _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
||||||
_sizing_eval(data);
|
_sizing_eval(data);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_content_resize(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
||||||
|
{
|
||||||
|
Widget_Data *wd = elm_widget_data_get(data);
|
||||||
|
Evas_Coord minw, minh;
|
||||||
|
edje_object_size_min_calc(wd->content, &minw, &minh);
|
||||||
|
evas_object_size_hint_min_set(wd->content, minw, minh);
|
||||||
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_sub_del(void *data, Evas_Object *obj, void *event_info)
|
_sub_del(void *data, Evas_Object *obj, void *event_info)
|
||||||
{
|
{
|
||||||
|
@ -68,8 +77,8 @@ _sub_del(void *data, Evas_Object *obj, void *event_info)
|
||||||
|
|
||||||
if (sub == wd->content)
|
if (sub == wd->content)
|
||||||
{
|
{
|
||||||
evas_object_event_callback_del(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
evas_object_event_callback_del_full(sub, EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||||
_changed_size_hints);
|
_changed_size_hints, obj);
|
||||||
wd->content = NULL;
|
wd->content = NULL;
|
||||||
_sizing_eval(obj);
|
_sizing_eval(obj);
|
||||||
}
|
}
|
||||||
|
@ -167,6 +176,9 @@ elm_frame_content_set(Evas_Object *obj, Evas_Object *content)
|
||||||
evas_object_event_callback_add(content,
|
evas_object_event_callback_add(content,
|
||||||
EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||||
_changed_size_hints, obj);
|
_changed_size_hints, obj);
|
||||||
|
evas_object_event_callback_add(content,
|
||||||
|
EVAS_CALLBACK_RESIZE,
|
||||||
|
_content_resize, obj);
|
||||||
_sizing_eval(obj);
|
_sizing_eval(obj);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue