setting extern min/max size overrides min/max sizes implied by objects

SVN revision: 7427
This commit is contained in:
Carsten Haitzler 2003-09-07 05:16:08 +00:00
parent 51b72e60a2
commit 62eb5b0b19
4 changed files with 38 additions and 16 deletions

View File

@ -68,10 +68,23 @@ main_start(int argc, char **argv)
ecore_event_handler_add(ECORE_EVENT_SIGNAL_EXIT, main_signal_exit, NULL);
if (!ecore_evas_init()) return -1;
#ifndef EDJE_FB_ONLY
{
int i;
for (i = 1; i < argc; i++)
{
if (!strcmp(argv[i], "-gl"))
{
ecore_evas = ecore_evas_gl_x11_new(NULL, 0, 0, 0, 240, 320);
goto canvas_up;
}
}
}
ecore_evas = ecore_evas_software_x11_new(NULL, 0, 0, 0, 240, 320);
#else
ecore_evas = ecore_evas_fb_new(NULL, 270, 240, 320);
#endif
canvas_up:
if (!ecore_evas) return -1;
ecore_evas_callback_delete_request_set(ecore_evas, main_delete_request);
ecore_evas_callback_resize_set(ecore_evas, main_resize);
@ -746,6 +759,7 @@ main(int argc, char **argv)
done = 0;
file = argv[i];
if (file[0] == '-') continue;
if (argc > (i + 1))
{
coll = argv[i + 1];

View File

@ -468,9 +468,9 @@ _edje_part_recalc_single(Edje *ed,
}
maxw = desc->max.w;
maxh = desc->max.h;
if ((ep->swallow_params.max.w > 0) &&
if ((ep->swallow_params.max.w >= 0) &&
(ep->swallow_params.max.w < maxw)) maxw = ep->swallow_params.max.w;
if ((ep->swallow_params.max.h > 0) &&
if ((ep->swallow_params.max.h >= 0) &&
(ep->swallow_params.max.h < maxh)) maxh = ep->swallow_params.max.h;
/* adjust for max size */
if (maxw >= 0)

View File

@ -161,6 +161,11 @@ edje_object_file_set(Evas_Object *obj, const char *file, const char *part)
}
if (rp->part->dragable.confine_id >= 0)
rp->confine_to = evas_list_nth(ed->parts, rp->part->dragable.confine_id);
rp->swallow_params.min.w = 0;
rp->swallow_params.min.w = 0;
rp->swallow_params.max.w = -1;
rp->swallow_params.max.h = -1;
}
_edje_ref(ed);
_edje_block(ed);

View File

@ -289,6 +289,10 @@ edje_object_part_swallow(Evas_Object *obj, const char *part, Evas_Object *obj_sw
_edje_object_part_swallow_free_cb,
obj);
type = (char *)evas_object_type_get(obj_swallow);
rp->swallow_params.min.w = 0;
rp->swallow_params.min.w = 0;
rp->swallow_params.max.w = -1;
rp->swallow_params.max.h = -1;
if ((type) && (!strcmp(type, "edje")))
{
double w, h;
@ -312,16 +316,17 @@ edje_object_part_swallow(Evas_Object *obj, const char *part, Evas_Object *obj_sw
rp->swallow_params.max.w = w;
rp->swallow_params.max.h = h;
}
else
{
rp->swallow_params.min.w =
(int)evas_object_data_get(obj_swallow, "\377 edje.minw");
rp->swallow_params.min.h =
(int)evas_object_data_get(obj_swallow, "\377 edje.minh");
rp->swallow_params.max.w =
(int)evas_object_data_get(obj_swallow, "\377 edje.maxw");
rp->swallow_params.max.h =
(int)evas_object_data_get(obj_swallow, "\377 edje.maxh");
int w1, h1, w2, h2;
w1 = (int)evas_object_data_get(obj_swallow, "\377 edje.minw");
h1 = (int)evas_object_data_get(obj_swallow, "\377 edje.minh");
w2 = (int)evas_object_data_get(obj_swallow, "\377 edje.maxw");
h2 = (int)evas_object_data_get(obj_swallow, "\377 edje.maxh");
rp->swallow_params.min.w = w1;
rp->swallow_params.min.h = h1;
if (w2 >= 0) rp->swallow_params.max.w = w2;
if (h2 >= 0) rp->swallow_params.max.w = h2;
}
ed->dirty = 1;
_edje_recalc(ed);
@ -333,8 +338,8 @@ edje_extern_object_min_size_set(Evas_Object *obj, double minw, double minh)
int mw, mh;
mw = minw;
if (mw < 0) mw = 0;
mh = minh;
if (mw < 0) mw = 0;
if (mh < 0) mh = 0;
if (mw > 0)
evas_object_data_set(obj, "\377 edje.minw", (void *)mw);
@ -352,14 +357,12 @@ edje_extern_object_max_size_set(Evas_Object *obj, double maxw, double maxh)
int mw, mh;
mw = maxw;
if (mw < 0) mw = 0;
mh = maxh;
if (mh < 0) mh = 0;
if (mw > 0)
if (mw >= 0)
evas_object_data_set(obj, "\377 edje.maxw", (void *)mw);
else
evas_object_data_del(obj, "\377 edje.maxw");
if (mh > 0)
if (mh >= 0)
evas_object_data_set(obj, "\377 edje.maxh", (void *)mh);
else
evas_object_data_del(obj, "\377 edje.maxh");