summaryrefslogtreecommitdiff
path: root/src/lib
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2019-07-30 13:11:30 -0400
committerMike Blumenkrantz <zmike@samsung.com>2019-07-30 13:12:52 -0400
commit46cf288d32f06a0c82ef227c65e55062bf494672 (patch)
tree44de2c2849fe1f8d252c01e9fd400bf45f1061f3 /src/lib
parent268d06d3810e0b4343e86d82ed7f42f5ac1ea80a (diff)
efl_ui/layout: implement group_calc, add finger size for inherited layouts
Summary: this adds a group_calc implementation for the layout object (not layout_base) to allow differentiation between inherited layout calcs and layout object calcs by using this, we can automatically apply finger size to inherited layout calcs if the implementation ever reaches this point Depends on D9435 Reviewers: bu5hm4n Reviewed By: bu5hm4n Subscribers: bu5hm4n, cedric, #reviewers, #committers Tags: #efl_widgets Maniphest Tasks: T8059 Differential Revision: https://phab.enlightenment.org/D9436
Diffstat (limited to 'src/lib')
-rw-r--r--src/lib/elementary/efl_ui_layout.c22
-rw-r--r--src/lib/elementary/efl_ui_layout.eo1
2 files changed, 17 insertions, 6 deletions
diff --git a/src/lib/elementary/efl_ui_layout.c b/src/lib/elementary/efl_ui_layout.c
index b00648e3a6..f36455773c 100644
--- a/src/lib/elementary/efl_ui_layout.c
+++ b/src/lib/elementary/efl_ui_layout.c
@@ -160,7 +160,7 @@ _part_cursor_free(Efl_Ui_Layout_Sub_Object_Cursor *pc)
160} 160}
161 161
162static void 162static void
163_sizing_eval(Evas_Object *obj, Efl_Ui_Layout_Data *sd) 163_sizing_eval(Evas_Object *obj, Efl_Ui_Layout_Data *sd, Eina_Bool finger)
164{ 164{
165 int minh = 0, minw = 0; 165 int minh = 0, minw = 0;
166 int rest_w = 0, rest_h = 0; 166 int rest_w = 0, rest_h = 0;
@@ -169,6 +169,8 @@ _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 (finger)
173 elm_coords_finger_size_adjust(1, &rest_w, 1, &rest_h);
172 if (elm_widget_is_legacy(obj)) 174 if (elm_widget_is_legacy(obj))
173 sz = efl_gfx_hint_size_combined_min_get(obj); 175 sz = efl_gfx_hint_size_combined_min_get(obj);
174 else 176 else
@@ -837,16 +839,24 @@ _efl_ui_layout_base_efl_canvas_group_group_del(Eo *obj, Efl_Ui_Layout_Data *sd)
837 efl_canvas_group_del(efl_super(obj, MY_CLASS)); 839 efl_canvas_group_del(efl_super(obj, MY_CLASS));
838} 840}
839 841
842EOLIAN static void
843_efl_ui_layout_efl_canvas_group_group_calculate(Eo *obj, void *_pd EINA_UNUSED)
844{
845 efl_canvas_group_need_recalculate_set(obj, EINA_FALSE);
846 _sizing_eval(obj, efl_data_scope_get(obj, MY_CLASS), NULL);
847}
848
840/* rewrite or extend this one on your derived class as to suit your 849/* rewrite or extend this one on your derived class as to suit your
841 * needs */ 850 * needs */
842EOLIAN static void 851EOLIAN static void
843_efl_ui_layout_base_efl_canvas_group_group_calculate(Eo *obj, Efl_Ui_Layout_Data *sd) 852_efl_ui_layout_base_efl_canvas_group_group_calculate(Eo *obj, Efl_Ui_Layout_Data *sd)
844{ 853{
845 if (sd->needs_size_calc) 854 Eina_Bool legacy = elm_widget_is_legacy(obj);
846 { 855 efl_canvas_group_need_recalculate_set(obj, EINA_FALSE);
847 _sizing_eval(obj, sd); 856 if ((!legacy) || sd->needs_size_calc)
848 sd->needs_size_calc = EINA_FALSE; 857 /* don't add finger size if this is an actual elm_layout object */
849 } 858 _sizing_eval(obj, sd, !legacy);
859 sd->needs_size_calc = EINA_FALSE;
850} 860}
851 861
852static Efl_Ui_Layout_Sub_Object_Cursor * 862static Efl_Ui_Layout_Sub_Object_Cursor *
diff --git a/src/lib/elementary/efl_ui_layout.eo b/src/lib/elementary/efl_ui_layout.eo
index bdc81db9c2..1f04fc023c 100644
--- a/src/lib/elementary/efl_ui_layout.eo
+++ b/src/lib/elementary/efl_ui_layout.eo
@@ -16,5 +16,6 @@ class Efl.Ui.Layout extends Efl.Ui.Layout_Base implements Efl.File
16 Efl.File.key { get; set; } 16 Efl.File.key { get; set; }
17 Efl.File.mmap { get; set; } 17 Efl.File.mmap { get; set; }
18 Efl.File.load; 18 Efl.File.load;
19 Efl.Canvas.Group.group_calculate;
19 } 20 }
20} 21}