diff options
author | Mike Blumenkrantz <zmike@samsung.com> | 2019-07-30 13:12:00 -0400 |
---|---|---|
committer | Mike Blumenkrantz <zmike@samsung.com> | 2019-07-30 13:12:52 -0400 |
commit | 872d43f0a06c1d28bca5981ad02723ab81b1ae7c (patch) | |
tree | eaf5116cdb8eed71feb0c1b59a3aefbc1771e866 /src/lib | |
parent | 4d79efce64db8c9be8a79a299fbeb2ae97b60af2 (diff) |
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
Diffstat (limited to 'src/lib')
-rw-r--r-- | src/lib/elementary/efl_ui_layout.c | 21 | ||||
-rw-r--r-- | src/lib/elementary/elm_widget_layout.h | 4 |
2 files changed, 14 insertions, 11 deletions
diff --git a/src/lib/elementary/efl_ui_layout.c b/src/lib/elementary/efl_ui_layout.c index 9576c2bfc6..f9865d231e 100644 --- a/src/lib/elementary/efl_ui_layout.c +++ b/src/lib/elementary/efl_ui_layout.c | |||
@@ -191,10 +191,13 @@ _sizing_eval(Evas_Object *obj, Efl_Ui_Layout_Data *sd, Elm_Layout_Data *ld) | |||
191 | if (minh > rest_h) | 191 | if (minh > rest_h) |
192 | rest_h = minh; | 192 | rest_h = minh; |
193 | 193 | ||
194 | if (sd->restricted_calc_w) | 194 | if (ld) |
195 | rest_w = wd->w; | 195 | { |
196 | if (sd->restricted_calc_h) | 196 | if (ld->restricted_calc_w) |
197 | rest_h = wd->h; | 197 | rest_w = MIN(wd->w, rest_w); |
198 | if (ld->restricted_calc_h) | ||
199 | rest_h = MIN(wd->h, rest_w); | ||
200 | } | ||
198 | 201 | ||
199 | edje_object_size_min_restricted_calc(wd->resize_obj, &minw, &minh, | 202 | edje_object_size_min_restricted_calc(wd->resize_obj, &minw, &minh, |
200 | rest_w, rest_h); | 203 | rest_w, rest_h); |
@@ -210,9 +213,9 @@ _sizing_eval(Evas_Object *obj, Efl_Ui_Layout_Data *sd, Elm_Layout_Data *ld) | |||
210 | 213 | ||
211 | if (ld) | 214 | if (ld) |
212 | { | 215 | { |
216 | ld->restricted_calc_w = ld->restricted_calc_h = EINA_FALSE; | ||
213 | efl_gfx_hint_size_min_set(obj, EINA_SIZE2D(minw, minh)); | 217 | efl_gfx_hint_size_min_set(obj, EINA_SIZE2D(minw, minh)); |
214 | } | 218 | } |
215 | sd->restricted_calc_w = sd->restricted_calc_h = EINA_FALSE; | ||
216 | } | 219 | } |
217 | 220 | ||
218 | void | 221 | void |
@@ -1811,11 +1814,11 @@ _elm_layout_sizing_eval(Eo *obj, Elm_Layout_Data *ld) | |||
1811 | EAPI void | 1814 | EAPI void |
1812 | elm_layout_sizing_restricted_eval(Eo *obj, Eina_Bool w, Eina_Bool h) | 1815 | elm_layout_sizing_restricted_eval(Eo *obj, Eina_Bool w, Eina_Bool h) |
1813 | { | 1816 | { |
1814 | Efl_Ui_Layout_Data *sd = efl_data_scope_safe_get(obj, MY_CLASS); | 1817 | Elm_Layout_Data *ld = efl_data_scope_safe_get(obj, ELM_LAYOUT_MIXIN); |
1815 | 1818 | ||
1816 | if (!sd) return; | 1819 | EINA_SAFETY_ON_NULL_RETURN(ld); |
1817 | sd->restricted_calc_w = !!w; | 1820 | ld->restricted_calc_w = !!w; |
1818 | sd->restricted_calc_h = !!h; | 1821 | ld->restricted_calc_h = !!h; |
1819 | 1822 | ||
1820 | efl_canvas_group_change(obj); | 1823 | efl_canvas_group_change(obj); |
1821 | } | 1824 | } |
diff --git a/src/lib/elementary/elm_widget_layout.h b/src/lib/elementary/elm_widget_layout.h index 8ec9668c8e..62949cae15 100644 --- a/src/lib/elementary/elm_widget_layout.h +++ b/src/lib/elementary/elm_widget_layout.h | |||
@@ -66,8 +66,6 @@ typedef struct _Efl_Ui_Layout_Data | |||
66 | 66 | ||
67 | unsigned int finger_size_multiplier_x, finger_size_multiplier_y; /**< multipliers for finger_size during group_calc */ | 67 | unsigned int finger_size_multiplier_x, finger_size_multiplier_y; /**< multipliers for finger_size during group_calc */ |
68 | 68 | ||
69 | Eina_Bool restricted_calc_w : 1; /**< This is a flag to support edje restricted_calc in w axis. */ | ||
70 | Eina_Bool restricted_calc_h : 1; /**< This is a flag to support edje restricted_calc in y axis. */ | ||
71 | Eina_Bool can_access : 1; /**< This is true when all text(including textblock) parts can be accessible by accessibility. */ | 69 | Eina_Bool can_access : 1; /**< This is true when all text(including textblock) parts can be accessible by accessibility. */ |
72 | 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. */ | 70 | 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. */ |
73 | Eina_Bool file_set : 1; /**< This flag indicates if Efl.Ui.Layout source is set from a file*/ | 71 | 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 | |||
80 | typedef struct _Elm_Layout_Data | 78 | typedef struct _Elm_Layout_Data |
81 | { | 79 | { |
82 | 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. */ | 80 | 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. */ |
81 | Eina_Bool restricted_calc_w : 1; /**< This is a flag to support edje restricted_calc in w axis. */ | ||
82 | Eina_Bool restricted_calc_h : 1; /**< This is a flag to support edje restricted_calc in y axis. */ | ||
83 | } Elm_Layout_Data; | 83 | } Elm_Layout_Data; |
84 | 84 | ||
85 | /** | 85 | /** |