elm_layout: move elm_layout_sizing_restricted_eval to layout mixin

Summary:
this function should never need to be called on new widgets

Depends on D9440

Reviewers: bu5hm4n

Reviewed By: bu5hm4n

Subscribers: bu5hm4n, cedric, #reviewers, #committers

Tags: #efl_widgets

Maniphest Tasks: T8059

Differential Revision: https://phab.enlightenment.org/D9441
This commit is contained in:
Mike Blumenkrantz 2019-07-30 13:12:00 -04:00
parent 4d79efce64
commit 872d43f0a0
2 changed files with 14 additions and 11 deletions

View File

@ -191,10 +191,13 @@ _sizing_eval(Evas_Object *obj, Efl_Ui_Layout_Data *sd, Elm_Layout_Data *ld)
if (minh > rest_h)
rest_h = minh;
if (sd->restricted_calc_w)
rest_w = wd->w;
if (sd->restricted_calc_h)
rest_h = wd->h;
if (ld)
{
if (ld->restricted_calc_w)
rest_w = MIN(wd->w, rest_w);
if (ld->restricted_calc_h)
rest_h = MIN(wd->h, rest_w);
}
edje_object_size_min_restricted_calc(wd->resize_obj, &minw, &minh,
rest_w, rest_h);
@ -210,9 +213,9 @@ _sizing_eval(Evas_Object *obj, Efl_Ui_Layout_Data *sd, Elm_Layout_Data *ld)
if (ld)
{
ld->restricted_calc_w = ld->restricted_calc_h = EINA_FALSE;
efl_gfx_hint_size_min_set(obj, EINA_SIZE2D(minw, minh));
}
sd->restricted_calc_w = sd->restricted_calc_h = EINA_FALSE;
}
void
@ -1811,11 +1814,11 @@ _elm_layout_sizing_eval(Eo *obj, Elm_Layout_Data *ld)
EAPI void
elm_layout_sizing_restricted_eval(Eo *obj, Eina_Bool w, Eina_Bool h)
{
Efl_Ui_Layout_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS);
Elm_Layout_Data *ld = efl_data_scope_safe_get(obj, ELM_LAYOUT_MIXIN);
if (!sd) return;
sd->restricted_calc_w = !!w;
sd->restricted_calc_h = !!h;
EINA_SAFETY_ON_NULL_RETURN(ld);
ld->restricted_calc_w = !!w;
ld->restricted_calc_h = !!h;
efl_canvas_group_change(obj);
}

View File

@ -66,8 +66,6 @@ typedef struct _Efl_Ui_Layout_Data
unsigned int finger_size_multiplier_x, finger_size_multiplier_y; /**< multipliers for finger_size during group_calc */
Eina_Bool restricted_calc_w : 1; /**< This is a flag to support edje restricted_calc in w axis. */
Eina_Bool restricted_calc_h : 1; /**< This is a flag to support edje restricted_calc in y axis. */
Eina_Bool can_access : 1; /**< This is true when all text(including textblock) parts can be accessible by accessibility. */
Eina_Bool destructed_is : 1; /**< This flag indicates if Efl.Ui.Layout destructor was called. This is needed to avoid unnecessary calculation of subobject deletion during layout object's deletion. */
Eina_Bool file_set : 1; /**< This flag indicates if Efl.Ui.Layout source is set from a file*/
@ -80,6 +78,8 @@ typedef struct _Efl_Ui_Layout_Data
typedef struct _Elm_Layout_Data
{
Eina_Bool needs_size_calc : 1; /**< This flag is set true when the layout sizing eval is already requested. This defers sizing evaluation until smart calculation to avoid unnecessary calculation. */
Eina_Bool restricted_calc_w : 1; /**< This is a flag to support edje restricted_calc in w axis. */
Eina_Bool restricted_calc_h : 1; /**< This is a flag to support edje restricted_calc in y axis. */
} Elm_Layout_Data;
/**