summaryrefslogtreecommitdiff
path: root/src
diff options
context:
space:
mode:
authorYeongjong Lee <cleanlyj@naver.com>2019-03-05 09:12:52 +0100
committerXavi Artigas <xavierartigas@yahoo.es>2019-03-05 09:31:19 +0100
commite013480e7a0ae11a9363f9a207cf63e3bb7f5423 (patch)
treeca6fc7698ddc714f5476cdb04d24b1487ba0eec8 /src
parent40bc81ae2ba30c371439fde3381cba16bf2b0677 (diff)
ui.box, ui.table: respect parent hint size min
Summary: This patch fixes issue that parent hint size min is ignored when it is greater than children hint size min sum. Thanks to segfaultxavi for reporting this. Test Plan: 1. make check 2. 'hello-gui' or 'texteditor' example in examples.git Reviewers: segfaultxavi, zmike Reviewed By: segfaultxavi Subscribers: cedric, #reviewers, #committers Tags: #efl Differential Revision: https://phab.enlightenment.org/D8098
Diffstat (limited to 'src')
-rw-r--r--src/lib/elementary/efl_ui_box_layout.c3
-rw-r--r--src/lib/elementary/efl_ui_container_layout.c4
-rw-r--r--src/lib/elementary/efl_ui_container_layout.h1
-rw-r--r--src/lib/elementary/efl_ui_table_layout.c5
-rw-r--r--src/tests/elementary/efl_ui_test_box.c1
-rw-r--r--src/tests/elementary/efl_ui_test_table.c1
6 files changed, 15 insertions, 0 deletions
diff --git a/src/lib/elementary/efl_ui_box_layout.c b/src/lib/elementary/efl_ui_box_layout.c
index bc9ea63c86..c66a1a8c2e 100644
--- a/src/lib/elementary/efl_ui_box_layout.c
+++ b/src/lib/elementary/efl_ui_box_layout.c
@@ -199,5 +199,8 @@ _efl_ui_box_custom_layout(Efl_Ui_Box *ui_box, Evas_Object_Box_Data *bd)
199 want[1] += (box_calc[1].margin[0] + box_calc[1].margin[1]) + 199 want[1] += (box_calc[1].margin[0] + box_calc[1].margin[1]) +
200 (box_calc[1].pad * (count - 1)); 200 (box_calc[1].pad * (count - 1));
201 201
202 if (want[0] < box_calc[0].min) want[0] = box_calc[0].min;
203 if (want[1] < box_calc[1].min) want[1] = box_calc[1].min;
204
202 efl_gfx_hint_size_min_set(ui_box, EINA_SIZE2D(want[0], want[1])); 205 efl_gfx_hint_size_min_set(ui_box, EINA_SIZE2D(want[0], want[1]));
203} 206}
diff --git a/src/lib/elementary/efl_ui_container_layout.c b/src/lib/elementary/efl_ui_container_layout.c
index e8c5979dd0..4fbdc07b91 100644
--- a/src/lib/elementary/efl_ui_container_layout.c
+++ b/src/lib/elementary/efl_ui_container_layout.c
@@ -112,10 +112,14 @@ _efl_ui_container_layout_init(Eo* obj, Efl_Ui_Container_Layout_Calc *calc)
112{ 112{
113 Eina_Rect geom; 113 Eina_Rect geom;
114 Eina_Bool pad_scalable; 114 Eina_Bool pad_scalable;
115 Eina_Size2D min;
115 116
116 geom = efl_gfx_entity_geometry_get(obj); 117 geom = efl_gfx_entity_geometry_get(obj);
117 efl_gfx_hint_margin_get(obj, &calc[0].margin[0], &calc[0].margin[1], 118 efl_gfx_hint_margin_get(obj, &calc[0].margin[0], &calc[0].margin[1],
118 &calc[1].margin[0], &calc[1].margin[1]); 119 &calc[1].margin[0], &calc[1].margin[1]);
120 min = efl_gfx_hint_size_combined_min_get(obj);
121 calc[0].min = min.w;
122 calc[1].min = min.h;
119 calc[0].scale = calc[1].scale = efl_gfx_entity_scale_get(obj); 123 calc[0].scale = calc[1].scale = efl_gfx_entity_scale_get(obj);
120 124
121 efl_pack_padding_get(obj, &calc[0].pad, &calc[1].pad, &pad_scalable); 125 efl_pack_padding_get(obj, &calc[0].pad, &calc[1].pad, &pad_scalable);
diff --git a/src/lib/elementary/efl_ui_container_layout.h b/src/lib/elementary/efl_ui_container_layout.h
index 097abee13b..85d3695e9d 100644
--- a/src/lib/elementary/efl_ui_container_layout.h
+++ b/src/lib/elementary/efl_ui_container_layout.h
@@ -28,6 +28,7 @@ struct _Efl_Ui_Container_Layout_Calc
28{ 28{
29 int pos; 29 int pos;
30 int size; 30 int size;
31 int min;
31 int margin[2]; 32 int margin[2];
32 double align; 33 double align;
33 double scale; 34 double scale;
diff --git a/src/lib/elementary/efl_ui_table_layout.c b/src/lib/elementary/efl_ui_table_layout.c
index b3009e9f7c..f017b33b9d 100644
--- a/src/lib/elementary/efl_ui_table_layout.c
+++ b/src/lib/elementary/efl_ui_table_layout.c
@@ -368,6 +368,11 @@ _efl_ui_table_custom_layout(Efl_Ui_Table *ui_table, Efl_Ui_Table_Data *pd)
368 + (table_calc.layout_calc[1].pad * 368 + (table_calc.layout_calc[1].pad *
369 table_calc.cell_calc[1][rows - 1].index); 369 table_calc.cell_calc[1][rows - 1].index);
370 370
371 if (table_calc.want[0] < table_calc.layout_calc[0].min)
372 table_calc.want[0] = table_calc.layout_calc[0].min;
373 if (table_calc.want[1] < table_calc.layout_calc[1].min)
374 table_calc.want[1] = table_calc.layout_calc[1].min;
375
371 efl_gfx_hint_size_min_set(ui_table, EINA_SIZE2D(table_calc.want[0], 376 efl_gfx_hint_size_min_set(ui_table, EINA_SIZE2D(table_calc.want[0],
372 table_calc.want[1])); 377 table_calc.want[1]));
373} 378}
diff --git a/src/tests/elementary/efl_ui_test_box.c b/src/tests/elementary/efl_ui_test_box.c
index af4eab0874..ee6532226c 100644
--- a/src/tests/elementary/efl_ui_test_box.c
+++ b/src/tests/elementary/efl_ui_test_box.c
@@ -187,6 +187,7 @@ static void
187btn_hint_set(Eo *btn, Hint *hint) 187btn_hint_set(Eo *btn, Hint *hint)
188{ 188{
189 efl_gfx_entity_size_set(layout, hint->layout_size); 189 efl_gfx_entity_size_set(layout, hint->layout_size);
190 efl_gfx_hint_size_min_set(layout, hint->layout_size);
190 efl_gfx_hint_size_max_set(btn, hint->max); 191 efl_gfx_hint_size_max_set(btn, hint->max);
191 efl_gfx_hint_size_min_set(btn, hint->min); 192 efl_gfx_hint_size_min_set(btn, hint->min);
192 efl_gfx_hint_weight_set(btn, hint->weightx, hint->weighty); 193 efl_gfx_hint_weight_set(btn, hint->weightx, hint->weighty);
diff --git a/src/tests/elementary/efl_ui_test_table.c b/src/tests/elementary/efl_ui_test_table.c
index 467208e651..66443efa6b 100644
--- a/src/tests/elementary/efl_ui_test_table.c
+++ b/src/tests/elementary/efl_ui_test_table.c
@@ -212,6 +212,7 @@ static void
212btn_hint_set(Eo *btn, Hint *hint) 212btn_hint_set(Eo *btn, Hint *hint)
213{ 213{
214 efl_gfx_entity_size_set(layout, hint->layout_size); 214 efl_gfx_entity_size_set(layout, hint->layout_size);
215 efl_gfx_hint_size_min_set(layout, hint->layout_size);
215 efl_gfx_hint_size_max_set(btn, hint->max); 216 efl_gfx_hint_size_max_set(btn, hint->max);
216 efl_gfx_hint_size_min_set(btn, hint->min); 217 efl_gfx_hint_size_min_set(btn, hint->min);
217 efl_gfx_hint_margin_set(btn, hint->marginl, hint->marginr, 218 efl_gfx_hint_margin_set(btn, hint->marginl, hint->marginr,