forked from enlightenment/efl
1. remove excess swallows - now edje handles that itself
2. beforfe show.. calc first so initial windowis the right size! SVN revision: 42953
This commit is contained in:
parent
142f0f04d9
commit
a4996f90ae
|
@ -59,10 +59,6 @@ static void
|
|||
_changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
||||
{
|
||||
Widget_Data *wd = elm_widget_data_get(data);
|
||||
if (wd->content)
|
||||
edje_object_part_swallow(wd->bbl, "elm.swallow.content", wd->content);
|
||||
if (wd->icon)
|
||||
edje_object_part_swallow(wd->bbl, "elm.swallow.icon", wd->icon);
|
||||
_sizing_eval(data);
|
||||
}
|
||||
|
||||
|
|
|
@ -85,7 +85,6 @@ _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
|||
Widget_Data *wd = elm_widget_data_get(data);
|
||||
if (!wd) return;
|
||||
if (obj != wd->icon) return;
|
||||
edje_object_part_swallow(wd->btn, "elm.swallow.content", obj);
|
||||
_sizing_eval(data);
|
||||
}
|
||||
|
||||
|
|
|
@ -98,7 +98,6 @@ _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
|||
{
|
||||
Widget_Data *wd = elm_widget_data_get(data);
|
||||
if (obj != wd->icon) return;
|
||||
edje_object_part_swallow(wd->chk, "elm.swallow.content", obj);
|
||||
Evas_Coord mw, mh;
|
||||
evas_object_size_hint_min_get(obj, &mw, &mh);
|
||||
_sizing_eval(data);
|
||||
|
|
|
@ -57,8 +57,6 @@ static void
|
|||
_changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
||||
{
|
||||
Widget_Data *wd = elm_widget_data_get(data);
|
||||
|
||||
edje_object_part_swallow(wd->frm, "elm.swallow.content", obj);
|
||||
_sizing_eval(data);
|
||||
}
|
||||
|
||||
|
|
|
@ -23,7 +23,6 @@ static void _del_hook(Evas_Object *obj);
|
|||
static void _theme_hook(Evas_Object *obj);
|
||||
static void _sizing_eval(Evas_Object *obj);
|
||||
static void _reval_content(Evas_Object *obj);
|
||||
static void _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info);
|
||||
static void _sub_del(void *data, Evas_Object *obj, void *event_info);
|
||||
static void _hov_show_do(Evas_Object *obj);
|
||||
static void _hov_move(void *data, Evas *e, Evas_Object *obj, void *event_info);
|
||||
|
@ -87,9 +86,7 @@ _sizing_eval(Evas_Object *obj)
|
|||
evas_object_move(wd->cov, x, y);
|
||||
evas_object_resize(wd->cov, w, h);
|
||||
evas_object_size_hint_min_set(wd->offset, x2 - x, y2 - y);
|
||||
edje_object_part_swallow(wd->cov, "elm.swallow.offset", wd->offset);
|
||||
evas_object_size_hint_min_set(wd->size, w2, h2);
|
||||
edje_object_part_swallow(wd->cov, "elm.swallow.size", wd->size);
|
||||
}
|
||||
|
||||
static void
|
||||
|
@ -103,23 +100,6 @@ _reval_content(Evas_Object *obj)
|
|||
edje_object_part_swallow(wd->cov, si->swallow, si->obj);
|
||||
}
|
||||
|
||||
static void
|
||||
_changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
||||
{
|
||||
Widget_Data *wd = elm_widget_data_get(data);
|
||||
const Eina_List *l;
|
||||
const Subinfo *si;
|
||||
|
||||
EINA_LIST_FOREACH(wd->subs, l, si)
|
||||
{
|
||||
if (si->obj == obj)
|
||||
{
|
||||
edje_object_part_swallow(wd->cov, si->swallow, si->obj);
|
||||
break;
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
static void
|
||||
_sub_del(void *data, Evas_Object *obj, void *event_info)
|
||||
{
|
||||
|
@ -132,9 +112,6 @@ _sub_del(void *data, Evas_Object *obj, void *event_info)
|
|||
{
|
||||
if (si->obj == sub)
|
||||
{
|
||||
evas_object_event_callback_del(sub,
|
||||
EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||
_changed_size_hints);
|
||||
wd->subs = eina_list_remove_list(wd->subs, l);
|
||||
eina_stringshare_del(si->swallow);
|
||||
free(si);
|
||||
|
@ -390,9 +367,6 @@ elm_hover_content_set(Evas_Object *obj, const char *swallow, Evas_Object *conten
|
|||
{
|
||||
elm_widget_sub_object_add(obj, content);
|
||||
edje_object_part_swallow(wd->cov, buf, content);
|
||||
evas_object_event_callback_add(content,
|
||||
EVAS_CALLBACK_CHANGED_SIZE_HINTS,
|
||||
_changed_size_hints, obj);
|
||||
si = ELM_NEW(Subinfo);
|
||||
si->swallow = eina_stringshare_add(buf);
|
||||
si->obj = content;
|
||||
|
|
|
@ -194,7 +194,6 @@ _index_box_auto_fill(Evas_Object *obj, Evas_Object *box, int level)
|
|||
Item *it, **itfit = NULL;
|
||||
Evas_Coord mw, mh, w, h;
|
||||
int i = 0;
|
||||
char buf[1024];
|
||||
|
||||
if (wd->level_active[level]) return;
|
||||
evas_object_geometry_get(box, NULL, NULL, &w, &h);
|
||||
|
@ -235,10 +234,7 @@ _index_box_auto_fill(Evas_Object *obj, Evas_Object *box, int level)
|
|||
}
|
||||
}
|
||||
}
|
||||
snprintf(buf, sizeof(buf), "elm.swallow.index.%i", level);
|
||||
// evas_object_size_hint_min_get(box, &mw, &mh);
|
||||
// evas_object_size_hint_min_set(box, mw, 0);
|
||||
edje_object_part_swallow(wd->base, buf, box);
|
||||
evas_object_smart_calculate(box);
|
||||
wd->level_active[level] = 1;
|
||||
}
|
||||
|
||||
|
@ -248,7 +244,6 @@ _index_box_clear(Evas_Object *obj, Evas_Object *box, int level)
|
|||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
Eina_List *l;
|
||||
Item *it;
|
||||
char buf[1024];
|
||||
|
||||
if (!wd->level_active[level]) return;
|
||||
EINA_LIST_FOREACH(wd->items, l, it)
|
||||
|
@ -258,8 +253,6 @@ _index_box_clear(Evas_Object *obj, Evas_Object *box, int level)
|
|||
evas_object_del(it->base);
|
||||
it->base = 0;
|
||||
}
|
||||
snprintf(buf, sizeof(buf), "elm.swallow.index.%i", level);
|
||||
edje_object_part_swallow(wd->base, buf, box);
|
||||
wd->level_active[level] = 0;
|
||||
}
|
||||
|
||||
|
|
|
@ -70,18 +70,7 @@ static void
|
|||
_changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
||||
{
|
||||
Widget_Data *wd = elm_widget_data_get(data);
|
||||
const Eina_List *l;
|
||||
const Subinfo *si;
|
||||
|
||||
EINA_LIST_FOREACH(wd->subs, l, si)
|
||||
{
|
||||
if (si->obj == obj)
|
||||
{
|
||||
edje_object_part_swallow(wd->lay, si->swallow, obj);
|
||||
_sizing_eval(data);
|
||||
break;
|
||||
}
|
||||
}
|
||||
_sizing_eval(data);
|
||||
}
|
||||
|
||||
static void
|
||||
|
|
|
@ -66,8 +66,6 @@ static void
|
|||
_changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
||||
{
|
||||
Widget_Data *wd = elm_widget_data_get(data);
|
||||
|
||||
edje_object_part_swallow(wd->notify, "elm.swallow.content", obj);
|
||||
_sizing_eval(data);
|
||||
}
|
||||
|
||||
|
|
|
@ -80,7 +80,6 @@ static void
|
|||
_changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
||||
{
|
||||
Item *it = data;
|
||||
edje_object_part_swallow(it->base, "elm.swallow.content", it->content);
|
||||
edje_object_size_min_calc(it->base, &it->minw, &it->minh);
|
||||
_sizing_eval(it->obj);
|
||||
}
|
||||
|
|
|
@ -119,7 +119,6 @@ _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
|||
{
|
||||
Widget_Data *wd = elm_widget_data_get(data);
|
||||
if (obj != wd->icon) return;
|
||||
edje_object_part_swallow(wd->progressbar, "elm.swallow.content", obj);
|
||||
_sizing_eval(data);
|
||||
}
|
||||
|
||||
|
|
|
@ -125,9 +125,6 @@ _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
|||
{
|
||||
Widget_Data *wd = elm_widget_data_get(data);
|
||||
if (obj != wd->icon) return;
|
||||
edje_object_part_swallow(wd->chk, "elm.swallow.content", obj);
|
||||
Evas_Coord mw, mh;
|
||||
evas_object_size_hint_min_get(obj, &mw, &mh);
|
||||
_sizing_eval(data);
|
||||
}
|
||||
|
||||
|
|
|
@ -124,7 +124,6 @@ _changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
|||
{
|
||||
Widget_Data *wd = elm_widget_data_get(data);
|
||||
if (obj != wd->icon) return;
|
||||
edje_object_part_swallow(wd->slider, "elm.swallow.content", obj);
|
||||
_sizing_eval(data);
|
||||
}
|
||||
|
||||
|
|
|
@ -67,6 +67,8 @@ static void
|
|||
_theme_hook(Evas_Object *obj)
|
||||
{
|
||||
Widget_Data *wd = elm_widget_data_get(obj);
|
||||
_elm_theme_set(wd->spinner, "spinner", "base", elm_widget_style_get(obj));
|
||||
edje_object_part_swallow(wd->spinner, "elm.swallow.entry", wd->ent);
|
||||
_write_label(obj);
|
||||
edje_object_message_signal_process(wd->spinner);
|
||||
edje_object_scale_set(wd->spinner, elm_widget_scale_get(obj) * _elm_config->scale);
|
||||
|
|
|
@ -84,11 +84,7 @@ static void
|
|||
_changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
||||
{
|
||||
Widget_Data *wd = elm_widget_data_get(data);
|
||||
Evas_Coord mw, mh;
|
||||
|
||||
if (obj != wd->icon) return;
|
||||
edje_object_part_swallow(wd->tgl, "elm.swallow.content", obj);
|
||||
evas_object_size_hint_min_get(obj, &mw, &mh);
|
||||
_sizing_eval(data);
|
||||
}
|
||||
|
||||
|
|
|
@ -22,6 +22,7 @@ struct _Elm_Win
|
|||
};
|
||||
|
||||
static void _elm_win_obj_callback_del(void *data, Evas *e, Evas_Object *obj, void *event_info);
|
||||
static void _elm_win_obj_callback_show(void *data, Evas *e, Evas_Object *obj, void *event_info);
|
||||
static void _elm_win_resize(Ecore_Evas *ee);
|
||||
static void _elm_win_delete_request(Ecore_Evas *ee);
|
||||
static void _elm_win_resize_job(void *data);
|
||||
|
@ -107,6 +108,15 @@ _elm_win_obj_callback_del(void *data, Evas *e, Evas_Object *obj, void *event_inf
|
|||
free(win);
|
||||
}
|
||||
|
||||
static void
|
||||
_elm_win_obj_callback_show(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
||||
{
|
||||
// this is called to make sure all smart containers have calculated their
|
||||
// sizes BEFORE we show the window to make sure it initially appears at
|
||||
// our desired size (ie min size is known first)
|
||||
evas_call_smarts_calculate(e);
|
||||
}
|
||||
|
||||
static void
|
||||
_elm_win_delete_request(Ecore_Evas *ee)
|
||||
{
|
||||
|
@ -356,6 +366,8 @@ elm_win_add(Evas_Object *parent, const char *name, Elm_Win_Type type)
|
|||
evas_object_layer_set(win->win_obj, 50);
|
||||
evas_object_pass_events_set(win->win_obj, 1);
|
||||
|
||||
evas_object_event_callback_add(win->win_obj, EVAS_CALLBACK_SHOW,
|
||||
_elm_win_obj_callback_show, win);
|
||||
ecore_evas_object_associate(win->ee, win->win_obj,
|
||||
ECORE_EVAS_OBJECT_ASSOCIATE_BASE |
|
||||
ECORE_EVAS_OBJECT_ASSOCIATE_STACK |
|
||||
|
@ -700,7 +712,6 @@ static void
|
|||
_changed_size_hints(void *data, Evas *e, Evas_Object *obj, void *event_info)
|
||||
{
|
||||
Widget_Data *wd = elm_widget_data_get(data);
|
||||
edje_object_part_swallow(wd->frm, "elm.swallow.content", obj);
|
||||
_sizing_eval(data);
|
||||
}
|
||||
|
||||
|
|
Loading…
Reference in New Issue