forked from enlightenment/efl
evas/wayland: Several fixes to make the framespace behave correctly.
- mark all children of a given smart object as "is_frame" if the smart object is also marked as a frame; - when moving a smart object, use the originally requested move coordinate to calculate the offset that the children should be moved too; - _smart_move_children_relative will fetch the child position with geometry_get(), this way getting the corrected object position, before adding the offset.
This commit is contained in:
parent
b73786814c
commit
6006432c3f
|
@ -832,13 +832,10 @@ _position_set(Eo *eo_obj, void *_pd, va_list *list)
|
||||||
evas = obj->layer->evas;
|
evas = obj->layer->evas;
|
||||||
|
|
||||||
if ((!obj->is_frame) && (eo_obj != evas->framespace.clip))
|
if ((!obj->is_frame) && (eo_obj != evas->framespace.clip))
|
||||||
{
|
|
||||||
if ((!obj->smart.parent) && (obj->is_smart))
|
|
||||||
{
|
{
|
||||||
nx += evas->framespace.x;
|
nx += evas->framespace.x;
|
||||||
ny += evas->framespace.y;
|
ny += evas->framespace.y;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (evas_object_intercept_call_move(eo_obj, obj, nx, ny)) return;
|
if (evas_object_intercept_call_move(eo_obj, obj, nx, ny)) return;
|
||||||
|
|
||||||
|
@ -864,7 +861,7 @@ _position_set(Eo *eo_obj, void *_pd, va_list *list)
|
||||||
|
|
||||||
if (obj->is_smart)
|
if (obj->is_smart)
|
||||||
{
|
{
|
||||||
eo_do(eo_obj, evas_obj_smart_move(nx, ny));
|
eo_do(eo_obj, evas_obj_smart_move(x, y));
|
||||||
}
|
}
|
||||||
|
|
||||||
EINA_COW_STATE_WRITE_BEGIN(obj, state_write, cur)
|
EINA_COW_STATE_WRITE_BEGIN(obj, state_write, cur)
|
||||||
|
@ -1026,13 +1023,10 @@ _position_get(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
|
||||||
evas = obj->layer->evas;
|
evas = obj->layer->evas;
|
||||||
|
|
||||||
if ((!obj->is_frame) && (eo_obj != evas->framespace.clip))
|
if ((!obj->is_frame) && (eo_obj != evas->framespace.clip))
|
||||||
{
|
|
||||||
if ((!obj->smart.parent) && (obj->is_smart))
|
|
||||||
{
|
{
|
||||||
if (nx > 0) nx -= evas->framespace.x;
|
if (nx > 0) nx -= evas->framespace.x;
|
||||||
if (ny > 0) ny -= evas->framespace.y;
|
if (ny > 0) ny -= evas->framespace.y;
|
||||||
}
|
}
|
||||||
}
|
|
||||||
|
|
||||||
if (x) *x = nx;
|
if (x) *x = nx;
|
||||||
if (y) *y = ny;
|
if (y) *y = ny;
|
||||||
|
@ -2455,11 +2449,31 @@ evas_object_is_frame_object_set(Evas_Object *eo_obj, Eina_Bool is_frame)
|
||||||
}
|
}
|
||||||
|
|
||||||
static void
|
static void
|
||||||
_is_frame_object_set(Eo *eo_obj EINA_UNUSED, void *_pd, va_list *list)
|
_is_frame_flag_set(Evas_Object_Protected_Data *obj, Eina_Bool is_frame)
|
||||||
{
|
{
|
||||||
Evas_Object_Protected_Data *obj = _pd;
|
const Eina_Inlist *l;
|
||||||
Eina_Bool is_frame = va_arg(*list, int);
|
Evas_Object_Protected_Data *child;
|
||||||
|
|
||||||
obj->is_frame = is_frame;
|
obj->is_frame = is_frame;
|
||||||
|
|
||||||
|
l = evas_object_smart_members_get_direct(obj->object);
|
||||||
|
|
||||||
|
EINA_INLIST_FOREACH(l, child)
|
||||||
|
_is_frame_flag_set(child, is_frame);
|
||||||
|
}
|
||||||
|
|
||||||
|
static void
|
||||||
|
_is_frame_object_set(Eo *eo_obj, void *_pd, va_list *list)
|
||||||
|
{
|
||||||
|
Eina_Bool is_frame = va_arg(*list, int);
|
||||||
|
Evas_Object_Protected_Data *obj = _pd;
|
||||||
|
Evas_Coord x, y;
|
||||||
|
|
||||||
|
evas_object_geometry_get(eo_obj, &x, &y, NULL, NULL);
|
||||||
|
|
||||||
|
_is_frame_flag_set(obj, is_frame);
|
||||||
|
|
||||||
|
evas_object_move(eo_obj, x, y);
|
||||||
}
|
}
|
||||||
|
|
||||||
EAPI Eina_Bool
|
EAPI Eina_Bool
|
||||||
|
|
|
@ -37,12 +37,12 @@ _smart_move_children_relative(Eo *eo_obj, void *_pd EINA_UNUSED, va_list *list)
|
||||||
{
|
{
|
||||||
Evas_Coord orig_x, orig_y;
|
Evas_Coord orig_x, orig_y;
|
||||||
|
|
||||||
// shortcut as we are in evas
|
|
||||||
// evas_object_geometry_get(child, &orig_x, &orig_y, NULL, NULL);
|
|
||||||
if (child->delete_me) continue;
|
if (child->delete_me) continue;
|
||||||
if (child->is_static_clip) continue;
|
if (child->is_static_clip) continue;
|
||||||
orig_x = child->cur->geometry.x;
|
// TODO: shortcut again, as we are in evas
|
||||||
orig_y = child->cur->geometry.y;
|
evas_object_geometry_get(child->object, &orig_x, &orig_y, NULL, NULL);
|
||||||
|
// orig_x = child->cur->geometry.x;
|
||||||
|
// orig_y = child->cur->geometry.y;
|
||||||
evas_object_move(child->object, orig_x + dx, orig_y + dy);
|
evas_object_move(child->object, orig_x + dx, orig_y + dy);
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Loading…
Reference in New Issue