diff options
author | Mike Blumenkrantz <zmike@samsung.com> | 2019-07-30 13:11:41 -0400 |
---|---|---|
committer | Mike Blumenkrantz <zmike@samsung.com> | 2019-07-30 13:12:52 -0400 |
commit | 586f41f92772ab789364bcd788e7717f92ba86de (patch) | |
tree | f3309903ebee274cdcca443046f7ecff394d90bb /src/lib | |
parent | e583eba56b2a27a1a7cbad5983a3f1958caed184 (diff) |
efl_ui/layout_base: add subobjs_calc internal functionality
Summary:
this functionality forces group_calc on a layout's subobjects during
layout group_calc so that the layout's own group_calc will yield consistent
and correct results
currently this is only used in panel widgets
Depends on D9437
Reviewers: bu5hm4n
Reviewed By: bu5hm4n
Subscribers: bu5hm4n, cedric, #reviewers, #committers
Tags: #efl_widgets
Maniphest Tasks: T8059
Differential Revision: https://phab.enlightenment.org/D9438
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/elementary/efl_ui_layout.c | 16 | ||||
-rw-r--r-- | src/lib/elementary/elm_widget_layout.h | 3 |
2 files changed, 19 insertions, 0 deletions
diff --git a/src/lib/elementary/efl_ui_layout.c b/src/lib/elementary/efl_ui_layout.c index c040d2dcd3..80b97abf63 100644 --- a/src/lib/elementary/efl_ui_layout.c +++ b/src/lib/elementary/efl_ui_layout.c | |||
@@ -169,6 +169,14 @@ _sizing_eval(Evas_Object *obj, Efl_Ui_Layout_Data *sd) | |||
169 | 169 | ||
170 | if (!efl_alive_get(obj)) return; | 170 | if (!efl_alive_get(obj)) return; |
171 | 171 | ||
172 | if (sd->calc_subobjs && !evas_smart_objects_calculating_get(evas_object_evas_get(obj))) | ||
173 | { | ||
174 | Eina_List *l; | ||
175 | Eo *subobj; | ||
176 | /* user has manually triggered a smart calc and wants subobjs to also calc */ | ||
177 | EINA_LIST_FOREACH(wd->subobjs, l, subobj) | ||
178 | efl_canvas_group_calculate(subobj); | ||
179 | } | ||
172 | elm_coords_finger_size_adjust(sd->finger_size_multiplier_x, &rest_w, | 180 | elm_coords_finger_size_adjust(sd->finger_size_multiplier_x, &rest_w, |
173 | sd->finger_size_multiplier_y, &rest_h); | 181 | sd->finger_size_multiplier_y, &rest_h); |
174 | if (elm_widget_is_legacy(obj)) | 182 | if (elm_widget_is_legacy(obj)) |
@@ -202,6 +210,14 @@ _sizing_eval(Evas_Object *obj, Efl_Ui_Layout_Data *sd) | |||
202 | sd->restricted_calc_w = sd->restricted_calc_h = EINA_FALSE; | 210 | sd->restricted_calc_w = sd->restricted_calc_h = EINA_FALSE; |
203 | } | 211 | } |
204 | 212 | ||
213 | void | ||
214 | _efl_ui_layout_subobjs_calc_set(Eo *obj, Eina_Bool set) | ||
215 | { | ||
216 | Efl_Ui_Layout_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS); | ||
217 | EINA_SAFETY_ON_NULL_RETURN(sd); | ||
218 | sd->calc_subobjs = !!set; | ||
219 | } | ||
220 | |||
205 | /* common content cases for layout objects: icon and text */ | 221 | /* common content cases for layout objects: icon and text */ |
206 | static inline void | 222 | static inline void |
207 | _signals_emit(Eo *obj, | 223 | _signals_emit(Eo *obj, |
diff --git a/src/lib/elementary/elm_widget_layout.h b/src/lib/elementary/elm_widget_layout.h index 1eb49bb2b3..d9cfa82e56 100644 --- a/src/lib/elementary/elm_widget_layout.h +++ b/src/lib/elementary/elm_widget_layout.h | |||
@@ -75,6 +75,7 @@ typedef struct _Elm_Layout_Smart_Data | |||
75 | Eina_Bool automatic_orientation_apply : 1; | 75 | Eina_Bool automatic_orientation_apply : 1; |
76 | Eina_Bool model_bound : 1; /**< Set to true once we are watching over a model*/ | 76 | Eina_Bool model_bound : 1; /**< Set to true once we are watching over a model*/ |
77 | Eina_Bool model_watch : 1; /**< Set to true once we do watch for model change*/ | 77 | Eina_Bool model_watch : 1; /**< Set to true once we do watch for model change*/ |
78 | Eina_Bool calc_subobjs : 1; /**< Set to true if group_calc should also handle subobjs during manual calc */ | ||
78 | } Efl_Ui_Layout_Data; | 79 | } Efl_Ui_Layout_Data; |
79 | 80 | ||
80 | /** | 81 | /** |
@@ -88,4 +89,6 @@ typedef struct _Elm_Layout_Smart_Data | |||
88 | if (EINA_UNLIKELY(!efl_isa(obj, EFL_UI_LAYOUT_BASE_CLASS))) \ | 89 | if (EINA_UNLIKELY(!efl_isa(obj, EFL_UI_LAYOUT_BASE_CLASS))) \ |
89 | return | 90 | return |
90 | 91 | ||
92 | void _efl_ui_layout_subobjs_calc_set(Eo *obj, Eina_Bool set); | ||
93 | |||
91 | #endif | 94 | #endif |