summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMike Blumenkrantz <zmike@samsung.com>2019-08-05 09:13:05 -0400
committerMarcel Hollerbach <mail@marcel-hollerbach.de>2019-08-07 14:48:39 +0200
commitf34f92bb29724c8e2c796c9787c2572d29d6619d (patch)
tree843f9064409709d0491c15ade89069626f3a95e6
parentc5030346d4b44690c652afa4e6eb91cfa8e552ea (diff)
efl_ui: use unified size hints api and be explicit about which hint is changed
unified widgets should use unified api internally and also be more explicit about which min size hint (restricted or user) is being set in order to improve readability of code when unified widgets also implement legacy wrappers, legacy api should be used for the legacy objects no functional changes Reviewed-by: Marcel Hollerbach <mail@marcel-hollerbach.de> Differential Revision: https://phab.enlightenment.org/D9495
-rw-r--r--src/lib/elementary/efl_ui_flip.c5
-rw-r--r--src/lib/elementary/efl_ui_frame.c5
-rw-r--r--src/lib/elementary/efl_ui_image.c5
-rw-r--r--src/lib/elementary/efl_ui_image_zoomable.c12
-rw-r--r--src/lib/elementary/efl_ui_list_view.c2
-rw-r--r--src/lib/elementary/efl_ui_panel.c12
-rw-r--r--src/lib/elementary/efl_ui_panes.c6
-rw-r--r--src/lib/elementary/efl_ui_progressbar.c24
-rw-r--r--src/lib/elementary/efl_ui_tags.c2
-rw-r--r--src/lib/elementary/efl_ui_textpath.c2
-rw-r--r--src/lib/elementary/efl_ui_win.c2
11 files changed, 46 insertions, 31 deletions
diff --git a/src/lib/elementary/efl_ui_flip.c b/src/lib/elementary/efl_ui_flip.c
index 23ce004d32..d6e9152146 100644
--- a/src/lib/elementary/efl_ui_flip.c
+++ b/src/lib/elementary/efl_ui_flip.c
@@ -93,7 +93,10 @@ _sizing_eval(Evas_Object *obj)
93 93
94 elm_coords_finger_size_adjust(fingx, &minw, fingy, &minh); 94 elm_coords_finger_size_adjust(fingx, &minw, fingy, &minh);
95 95
96 evas_object_size_hint_min_set(obj, minw, minh); 96 if (elm_widget_is_legacy(obj))
97 evas_object_size_hint_min_set(obj, minw, minh);
98 else
99 efl_gfx_hint_size_restricted_min_set(obj, EINA_SIZE2D(minw, minh));
97 evas_object_size_hint_max_set(obj, maxw, maxh); 100 evas_object_size_hint_max_set(obj, maxw, maxh);
98} 101}
99 102
diff --git a/src/lib/elementary/efl_ui_frame.c b/src/lib/elementary/efl_ui_frame.c
index 4f8891a0cc..1f167fb495 100644
--- a/src/lib/elementary/efl_ui_frame.c
+++ b/src/lib/elementary/efl_ui_frame.c
@@ -38,7 +38,10 @@ _sizing_eval(Evas_Object *obj,
38 evas_object_size_hint_min_get(obj, &cminw, &cminh); 38 evas_object_size_hint_min_get(obj, &cminw, &cminh);
39 if ((minw == cminw) && (minh == cminh)) return; 39 if ((minw == cminw) && (minh == cminh)) return;
40 40
41 evas_object_size_hint_min_set(obj, minw, minh); 41 if (elm_widget_is_legacy(obj))
42 evas_object_size_hint_min_set(obj, minw, minh);
43 else
44 efl_gfx_hint_size_restricted_min_set(obj, EINA_SIZE2D(minw, minh));
42 evas_object_size_hint_max_set(obj, -1, -1); 45 evas_object_size_hint_max_set(obj, -1, -1);
43} 46}
44 47
diff --git a/src/lib/elementary/efl_ui_image.c b/src/lib/elementary/efl_ui_image.c
index 342c9d2d56..68403700be 100644
--- a/src/lib/elementary/efl_ui_image.c
+++ b/src/lib/elementary/efl_ui_image.c
@@ -802,7 +802,10 @@ _efl_ui_image_sizing_eval(Evas_Object *obj)
802 } 802 }
803 } 803 }
804 804
805 evas_object_size_hint_min_set(obj, minw, minh); 805 if (elm_widget_is_legacy(obj))
806 evas_object_size_hint_min_set(obj, minw, minh);
807 else
808 efl_gfx_hint_size_restricted_min_set(obj, EINA_SIZE2D(minw, minh));
806 evas_object_size_hint_max_set(obj, maxw, maxh); 809 evas_object_size_hint_max_set(obj, maxw, maxh);
807 810
808 if (sd->img) 811 if (sd->img)
diff --git a/src/lib/elementary/efl_ui_image_zoomable.c b/src/lib/elementary/efl_ui_image_zoomable.c
index 6b529d210d..4b76f6bde4 100644
--- a/src/lib/elementary/efl_ui_image_zoomable.c
+++ b/src/lib/elementary/efl_ui_image_zoomable.c
@@ -116,7 +116,10 @@ _sizing_eval(Evas_Object *obj)
116 116
117 evas_object_size_hint_max_get 117 evas_object_size_hint_max_get
118 (wd->resize_obj, &maxw, &maxh); 118 (wd->resize_obj, &maxw, &maxh);
119 evas_object_size_hint_min_set(obj, minw, minh); 119 if (elm_widget_is_legacy(obj))
120 evas_object_size_hint_min_set(obj, minw, minh);
121 else
122 efl_gfx_hint_size_restricted_min_set(obj, EINA_SIZE2D(minw, minh));
120 evas_object_size_hint_max_set(obj, maxw, maxh); 123 evas_object_size_hint_max_set(obj, maxw, maxh);
121} 124}
122 125
@@ -1861,7 +1864,10 @@ _efl_ui_image_zoomable_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Image_Zoomable
1861 (priv->img, EVAS_CALLBACK_IMAGE_PRELOADED, _main_img_preloaded_cb, obj); 1864 (priv->img, EVAS_CALLBACK_IMAGE_PRELOADED, _main_img_preloaded_cb, obj);
1862 1865
1863 edje_object_size_min_calc(edje, &minw, &minh); 1866 edje_object_size_min_calc(edje, &minw, &minh);
1864 evas_object_size_hint_min_set(obj, minw, minh); 1867 if (elm_widget_is_legacy(obj))
1868 evas_object_size_hint_min_set(obj, minw, minh);
1869 else
1870 efl_gfx_hint_size_restricted_min_set(obj, EINA_SIZE2D(minw, minh));
1865 1871
1866 _efl_ui_image_zoomable_edje_object_attach(obj); 1872 _efl_ui_image_zoomable_edje_object_attach(obj);
1867 1873
@@ -2028,7 +2034,7 @@ _img_proxy_set(Evas_Object *obj, Efl_Ui_Image_Zoomable_Data *sd,
2028 2034
2029 evas_object_image_source_set(sd->img, sd->edje); 2035 evas_object_image_source_set(sd->img, sd->edje);
2030 evas_object_image_source_visible_set(sd->img, EINA_FALSE); 2036 evas_object_image_source_visible_set(sd->img, EINA_FALSE);
2031 evas_object_size_hint_min_set(sd->img, w, h); 2037 efl_gfx_hint_size_min_set(sd->img, EINA_SIZE2D(w, h));
2032 evas_object_show(sd->img); 2038 evas_object_show(sd->img);
2033 evas_object_show(sd->edje); 2039 evas_object_show(sd->edje);
2034 2040
diff --git a/src/lib/elementary/efl_ui_list_view.c b/src/lib/elementary/efl_ui_list_view.c
index 0a686e740a..78812853ae 100644
--- a/src/lib/elementary/efl_ui_list_view.c
+++ b/src/lib/elementary/efl_ui_list_view.c
@@ -862,7 +862,7 @@ _efl_ui_list_view_efl_ui_list_view_model_min_size_set(Eo *obj, Efl_Ui_List_View_
862 pd->min.w = min.w; 862 pd->min.w = min.w;
863 pd->min.h = min.h; 863 pd->min.h = min.h;
864 864
865 evas_object_size_hint_min_set(wd->resize_obj, pd->min.w, pd->min.h); 865 efl_gfx_hint_size_min_set(wd->resize_obj, EINA_SIZE2D(pd->min.w, pd->min.h));
866 efl_event_callback_call(pd->pan_obj, EFL_UI_PAN_EVENT_PAN_CONTENT_CHANGED, NULL); 866 efl_event_callback_call(pd->pan_obj, EFL_UI_PAN_EVENT_PAN_CONTENT_CHANGED, NULL);
867} 867}
868 868
diff --git a/src/lib/elementary/efl_ui_panel.c b/src/lib/elementary/efl_ui_panel.c
index cad4a8f807..1f6f21da8c 100644
--- a/src/lib/elementary/efl_ui_panel.c
+++ b/src/lib/elementary/efl_ui_panel.c
@@ -228,7 +228,7 @@ _efl_ui_panel_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Panel_Data *sd)
228 228
229 evas_object_hide(sd->event); 229 evas_object_hide(sd->event);
230 elm_coords_finger_size_adjust(1, &minw, 1, &minh); 230 elm_coords_finger_size_adjust(1, &minw, 1, &minh);
231 evas_object_size_hint_min_set(sd->event, minw, minh); 231 efl_gfx_hint_size_min_set(sd->event, EINA_SIZE2D(minw, minh));
232 232
233 if (edje_object_part_exists(wd->resize_obj, "efl.swallow.event")) 233 if (edje_object_part_exists(wd->resize_obj, "efl.swallow.event"))
234 efl_content_set(efl_part(efl_super(obj, MY_CLASS), "efl.swallow.event"), sd->event); 234 efl_content_set(efl_part(efl_super(obj, MY_CLASS), "efl.swallow.event"), sd->event);
@@ -770,15 +770,15 @@ _scrollable_layout_resize(Eo *obj, Efl_Ui_Panel_Data *sd, Evas_Coord w, Evas_Coo
770 case EFL_UI_PANEL_ORIENT_BOTTOM: 770 case EFL_UI_PANEL_ORIENT_BOTTOM:
771 // vertical 771 // vertical
772 evas_object_resize(sd->scr_ly, w, (1 + sd->content_size_ratio) * h); 772 evas_object_resize(sd->scr_ly, w, (1 + sd->content_size_ratio) * h);
773 evas_object_size_hint_min_set(sd->scr_panel, w, (sd->content_size_ratio * h)); 773 efl_gfx_hint_size_min_set(sd->scr_panel, EINA_SIZE2D(w, (sd->content_size_ratio * h)));
774 evas_object_size_hint_min_set(sd->scr_event, w, h); 774 efl_gfx_hint_size_min_set(sd->scr_event, EINA_SIZE2D(w, h));
775 break; 775 break;
776 case EFL_UI_PANEL_ORIENT_LEFT: 776 case EFL_UI_PANEL_ORIENT_LEFT:
777 case EFL_UI_PANEL_ORIENT_RIGHT: 777 case EFL_UI_PANEL_ORIENT_RIGHT:
778 // horizontal 778 // horizontal
779 evas_object_resize(sd->scr_ly, (1 + sd->content_size_ratio) * w, h); 779 evas_object_resize(sd->scr_ly, (1 + sd->content_size_ratio) * w, h);
780 evas_object_size_hint_min_set(sd->scr_panel, (sd->content_size_ratio * w), h); 780 efl_gfx_hint_size_min_set(sd->scr_panel, EINA_SIZE2D((sd->content_size_ratio * w), h));
781 evas_object_size_hint_min_set(sd->scr_event, w, h); 781 efl_gfx_hint_size_min_set(sd->scr_event, EINA_SIZE2D(w, h));
782 break; 782 break;
783 } 783 }
784 efl_canvas_group_change(obj); 784 efl_canvas_group_change(obj);
@@ -868,7 +868,7 @@ _efl_ui_panel_efl_object_constructor(Eo *obj, Efl_Ui_Panel_Data *_pd)
868 Evas_Coord minw = 0, minh = 0; 868 Evas_Coord minw = 0, minh = 0;
869 869
870 elm_coords_finger_size_adjust(1, &minw, 1, &minh); 870 elm_coords_finger_size_adjust(1, &minw, 1, &minh);
871 evas_object_size_hint_min_set(_pd->event, minw, minh); 871 efl_gfx_hint_size_min_set(_pd->event, EINA_SIZE2D(minw, minh));
872 efl_content_set(efl_part(efl_super(obj, MY_CLASS), "efl.swallow.event"), _pd->event); 872 efl_content_set(efl_part(efl_super(obj, MY_CLASS), "efl.swallow.event"), _pd->event);
873 } 873 }
874 } 874 }
diff --git a/src/lib/elementary/efl_ui_panes.c b/src/lib/elementary/efl_ui_panes.c
index 30f5770a90..3b6db20f40 100644
--- a/src/lib/elementary/efl_ui_panes.c
+++ b/src/lib/elementary/efl_ui_panes.c
@@ -129,7 +129,7 @@ _efl_ui_panes_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Panes_Data *sd)
129 129
130 evas_object_hide(sd->event); 130 evas_object_hide(sd->event);
131 elm_coords_finger_size_adjust(1, &minw, 1, &minh); 131 elm_coords_finger_size_adjust(1, &minw, 1, &minh);
132 evas_object_size_hint_min_set(sd->event, minw, minh); 132 efl_gfx_hint_size_min_set(sd->event, EINA_SIZE2D(minw, minh));
133 133
134 int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS)); 134 int_ret = efl_ui_widget_theme_apply(efl_super(obj, MY_CLASS));
135 if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret; 135 if (int_ret == EFL_UI_THEME_APPLY_ERROR_GENERIC) return int_ret;
@@ -468,7 +468,7 @@ _efl_ui_panes_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Panes_Data *_pd EINA_UN
468 Evas_Coord minw = 0, minh = 0; 468 Evas_Coord minw = 0, minh = 0;
469 469
470 elm_coords_finger_size_adjust(1, &minw, 1, &minh); 470 elm_coords_finger_size_adjust(1, &minw, 1, &minh);
471 evas_object_size_hint_min_set(sd->event, minw, minh); 471 efl_gfx_hint_size_min_set(sd->event, EINA_SIZE2D(minw, minh));
472 elm_layout_content_set(obj, "elm.swallow.event", sd->event); 472 elm_layout_content_set(obj, "elm.swallow.event", sd->event);
473 } 473 }
474 } 474 }
@@ -480,7 +480,7 @@ _efl_ui_panes_efl_canvas_group_group_add(Eo *obj, Efl_Ui_Panes_Data *_pd EINA_UN
480 Evas_Coord minw = 0, minh = 0; 480 Evas_Coord minw = 0, minh = 0;
481 481
482 elm_coords_finger_size_adjust(1, &minw, 1, &minh); 482 elm_coords_finger_size_adjust(1, &minw, 1, &minh);
483 evas_object_size_hint_min_set(sd->event, minw, minh); 483 efl_gfx_hint_size_min_set(sd->event, EINA_SIZE2D(minw, minh));
484 elm_layout_content_set(obj, "efl.event", sd->event); 484 elm_layout_content_set(obj, "efl.event", sd->event);
485 } 485 }
486 } 486 }
diff --git a/src/lib/elementary/efl_ui_progressbar.c b/src/lib/elementary/efl_ui_progressbar.c
index f80b40badb..4ea4b26482 100644
--- a/src/lib/elementary/efl_ui_progressbar.c
+++ b/src/lib/elementary/efl_ui_progressbar.c
@@ -249,13 +249,13 @@ _efl_ui_progressbar_efl_ui_widget_theme_apply(Eo *obj, Efl_Ui_Progressbar_Data *
249 sd->has_cur_progressbar_part = edje_object_part_exists(obj, curprogresspart[elm_widget_is_legacy(obj)]); 249 sd->has_cur_progressbar_part = edje_object_part_exists(obj, curprogresspart[elm_widget_is_legacy(obj)]);
250 250
251 if (_is_horizontal(sd->dir)) 251 if (_is_horizontal(sd->dir))
252 evas_object_size_hint_min_set 252 efl_gfx_hint_size_min_set
253 (sd->spacer, (double)sd->size * efl_gfx_entity_scale_get(obj) * 253 (sd->spacer, EINA_SIZE2D((double)sd->size * efl_gfx_entity_scale_get(obj) *
254 elm_config_scale_get(), 1); 254 elm_config_scale_get(), 1));
255 else 255 else
256 evas_object_size_hint_min_set 256 efl_gfx_hint_size_min_set
257 (sd->spacer, 1, (double)sd->size * efl_gfx_entity_scale_get(obj) * 257 (sd->spacer, EINA_SIZE2D(1, (double)sd->size * efl_gfx_entity_scale_get(obj) *
258 elm_config_scale_get()); 258 elm_config_scale_get()));
259 259
260 if (elm_widget_is_legacy(obj)) 260 if (elm_widget_is_legacy(obj))
261 { 261 {
@@ -447,13 +447,13 @@ _progressbar_span_size_set(Eo *obj, Efl_Ui_Progressbar_Data *sd, Evas_Coord size
447 sd->size = size; 447 sd->size = size;
448 448
449 if (_is_horizontal(sd->dir)) 449 if (_is_horizontal(sd->dir))
450 evas_object_size_hint_min_set 450 efl_gfx_hint_size_min_set
451 (sd->spacer, (double)sd->size * efl_gfx_entity_scale_get(obj) * 451 (sd->spacer, EINA_SIZE2D((double)sd->size * efl_gfx_entity_scale_get(obj) *
452 elm_config_scale_get(), 1); 452 elm_config_scale_get(), 1));
453 else 453 else
454 evas_object_size_hint_min_set 454 efl_gfx_hint_size_min_set
455 (sd->spacer, 1, (double)sd->size * efl_gfx_entity_scale_get(obj) * 455 (sd->spacer, EINA_SIZE2D(1, (double)sd->size * efl_gfx_entity_scale_get(obj) *
456 elm_config_scale_get()); 456 elm_config_scale_get()));
457 457
458 efl_canvas_group_change(obj); 458 efl_canvas_group_change(obj);
459} 459}
diff --git a/src/lib/elementary/efl_ui_tags.c b/src/lib/elementary/efl_ui_tags.c
index f4a10b48a5..b06e4a512f 100644
--- a/src/lib/elementary/efl_ui_tags.c
+++ b/src/lib/elementary/efl_ui_tags.c
@@ -719,7 +719,7 @@ _label_set(Evas_Object *obj,
719 efl_pack_unpack(sd->box, sd->label); 719 efl_pack_unpack(sd->box, sd->label);
720 sd->label_packed = EINA_TRUE; 720 sd->label_packed = EINA_TRUE;
721 edje_object_size_min_calc(sd->label, &width, &height); 721 edje_object_size_min_calc(sd->label, &width, &height);
722 evas_object_size_hint_min_set(sd->label, width, height); 722 efl_gfx_hint_size_min_set(sd->label, EINA_SIZE2D(width, height));
723 efl_pack_begin(sd->box, sd->label); 723 efl_pack_begin(sd->box, sd->label);
724 evas_object_show(sd->label); 724 evas_object_show(sd->label);
725 } 725 }
diff --git a/src/lib/elementary/efl_ui_textpath.c b/src/lib/elementary/efl_ui_textpath.c
index bfd51ee008..cee16ffe29 100644
--- a/src/lib/elementary/efl_ui_textpath.c
+++ b/src/lib/elementary/efl_ui_textpath.c
@@ -552,7 +552,7 @@ _ellipsis_set(Efl_Ui_Textpath_Data *pd, Eo *obj)
552 tb = edje_object_part_object_get(pd->text_obj, "efl.text"); 552 tb = edje_object_part_object_get(pd->text_obj, "efl.text");
553 553
554 evas_object_textblock_size_native_get(tb, &w, &h); 554 evas_object_textblock_size_native_get(tb, &w, &h);
555 evas_object_size_hint_min_set(pd->text_obj, w, h); 555 efl_gfx_hint_size_restricted_min_set(pd->text_obj, EINA_SIZE2D(w, h));
556 if (pd->ellipsis) 556 if (pd->ellipsis)
557 { 557 {
558 if (w > pd->total_length) 558 if (w > pd->total_length)
diff --git a/src/lib/elementary/efl_ui_win.c b/src/lib/elementary/efl_ui_win.c
index e496515015..22ed4f1962 100644
--- a/src/lib/elementary/efl_ui_win.c
+++ b/src/lib/elementary/efl_ui_win.c
@@ -5024,7 +5024,7 @@ _indicator_resized(void *data, const Efl_Event *event)
5024 ELM_WIN_DATA_GET_OR_RETURN(data, sd); 5024 ELM_WIN_DATA_GET_OR_RETURN(data, sd);
5025 Evas_Object *indicator = event->object; 5025 Evas_Object *indicator = event->object;
5026 Evas_Coord_Size *size = (Evas_Coord_Size *)event->info; 5026 Evas_Coord_Size *size = (Evas_Coord_Size *)event->info;
5027 efl_gfx_hint_size_restricted_min_set(indicator, EINA_SIZE2D(size->w, size->h)); 5027 efl_gfx_hint_size_min_set(indicator, EINA_SIZE2D(size->w, size->h));
5028 _elm_win_frame_obj_update(sd, 0); 5028 _elm_win_frame_obj_update(sd, 0);
5029} 5029}
5030 5030