summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorGustavo Sverzut Barbieri <barbieri@gmail.com>2012-11-30 20:59:30 +0000
committerGustavo Sverzut Barbieri <barbieri@gmail.com>2012-11-30 20:59:30 +0000
commit8ecc92524907aadf05ba54f9cede3f73877b8717 (patch)
tree8a135eccfd7d008f88988f231ac25f9bdbb53fab
parent90e312173ac0f86b0372027b349f23687b1e2d3a (diff)
bugfix: evas_object_box should reset size_hint_min to zero when no child exists.
there are some early-return code that were leaving the size_hint as it was before, then if you removed every child it should go to 0x0 but couldn't. PLEASE BACKPORT THIS TO 1.7 BRANCH FOR ME :-( SVN revision: 79948
-rw-r--r--ChangeLog5
-rw-r--r--NEWS1
-rw-r--r--src/lib/evas/canvas/evas_object_box.c50
3 files changed, 46 insertions, 10 deletions
diff --git a/ChangeLog b/ChangeLog
index d006b7d3e0..e3b698ac9e 100644
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,8 @@
12012-11-30 Gustavo Sverzut Barbieri (k-s)
2
3 * Fix evas_object_box.c to properly reset size_hint_min to zero if
4 there are no objects packed into the box.
5
12012-11-22 Paulo Alcantara (pcacjr) 62012-11-22 Paulo Alcantara (pcacjr)
2 7
3 * Add scalecache support to Cserve2 8 * Add scalecache support to Cserve2
diff --git a/NEWS b/NEWS
index 292adefad0..b76af1d1b3 100644
--- a/NEWS
+++ b/NEWS
@@ -28,3 +28,4 @@ Fixes:
28 * Fixed glGetIntegerv() in Direct Rendering mode for Evas GL 28 * Fixed glGetIntegerv() in Direct Rendering mode for Evas GL
29 to properly handle GL_SCISSOR_BOX and GL_VIEWPORT parameters. 29 to properly handle GL_SCISSOR_BOX and GL_VIEWPORT parameters.
30 * Fixed textblock textprop leak. 30 * Fixed textblock textprop leak.
31 * Fixed evas_object_box to reset size_hint_min to zero when no child.
diff --git a/src/lib/evas/canvas/evas_object_box.c b/src/lib/evas/canvas/evas_object_box.c
index e8c694f271..16d6275b67 100644
--- a/src/lib/evas/canvas/evas_object_box.c
+++ b/src/lib/evas/canvas/evas_object_box.c
@@ -745,11 +745,17 @@ _box_layout_horizontal(Eo *o, void *_pd, va_list *list EINA_UNUSED)
745 745
746 n_children = eina_list_count(priv->children); 746 n_children = eina_list_count(priv->children);
747 if (!n_children) 747 if (!n_children)
748 return; 748 {
749 evas_object_size_hint_min_set(o, 0, 0);
750 return;
751 }
749 752
750 objects = (Evas_Object_Box_Option **)alloca(sizeof(Evas_Object_Box_Option *) * n_children); 753 objects = (Evas_Object_Box_Option **)alloca(sizeof(Evas_Object_Box_Option *) * n_children);
751 if (!objects) 754 if (!objects)
752 return; 755 {
756 evas_object_size_hint_min_set(o, 0, 0);
757 return;
758 }
753 759
754 evas_object_geometry_get(o, &x, &y, &w, &h); 760 evas_object_geometry_get(o, &x, &y, &w, &h);
755 global_pad = priv->pad.h; 761 global_pad = priv->pad.h;
@@ -911,11 +917,17 @@ _box_layout_vertical(Eo *o, void *_pd, va_list *list EINA_UNUSED)
911 917
912 n_children = eina_list_count(priv->children); 918 n_children = eina_list_count(priv->children);
913 if (!n_children) 919 if (!n_children)
914 return; 920 {
921 evas_object_size_hint_min_set(o, 0, 0);
922 return;
923 }
915 924
916 objects = (Evas_Object_Box_Option **)alloca(sizeof(Evas_Object_Box_Option *) * n_children); 925 objects = (Evas_Object_Box_Option **)alloca(sizeof(Evas_Object_Box_Option *) * n_children);
917 if (!objects) 926 if (!objects)
918 return; 927 {
928 evas_object_size_hint_min_set(o, 0, 0);
929 return;
930 }
919 931
920 evas_object_geometry_get(o, &x, &y, &w, &h); 932 evas_object_geometry_get(o, &x, &y, &w, &h);
921 global_pad = priv->pad.v; 933 global_pad = priv->pad.v;
@@ -1021,7 +1033,10 @@ _box_layout_homogeneous_horizontal(Eo *o, void *_pd, va_list *list EINA_UNUSED)
1021 1033
1022 n_children = eina_list_count(priv->children); 1034 n_children = eina_list_count(priv->children);
1023 if (!n_children) 1035 if (!n_children)
1024 return; 1036 {
1037 evas_object_size_hint_min_set(o, 0, 0);
1038 return;
1039 }
1025 1040
1026 evas_object_geometry_get(o, &x, &y, &w, &h); 1041 evas_object_geometry_get(o, &x, &y, &w, &h);
1027 1042
@@ -1090,7 +1105,10 @@ _box_layout_homogeneous_vertical(Eo *o, void *_pd, va_list *list EINA_UNUSED)
1090 1105
1091 n_children = eina_list_count(priv->children); 1106 n_children = eina_list_count(priv->children);
1092 if (!n_children) 1107 if (!n_children)
1093 return; 1108 {
1109 evas_object_size_hint_min_set(o, 0, 0);
1110 return;
1111 }
1094 1112
1095 evas_object_geometry_get(o, &x, &y, &w, &h); 1113 evas_object_geometry_get(o, &x, &y, &w, &h);
1096 1114
@@ -1159,7 +1177,10 @@ _box_layout_homogeneous_max_size_horizontal(Eo *o, void *_pd, va_list *list EINA
1159 1177
1160 n_children = eina_list_count(priv->children); 1178 n_children = eina_list_count(priv->children);
1161 if (!n_children) 1179 if (!n_children)
1162 return; 1180 {
1181 evas_object_size_hint_min_set(o, 0, 0);
1182 return;
1183 }
1163 1184
1164 evas_object_geometry_get(o, &x, &y, &w, &h); 1185 evas_object_geometry_get(o, &x, &y, &w, &h);
1165 1186
@@ -1251,7 +1272,10 @@ _box_layout_homogeneous_max_size_vertical(Eo *o, void *_pd, va_list *list EINA_U
1251 1272
1252 n_children = eina_list_count(priv->children); 1273 n_children = eina_list_count(priv->children);
1253 if (!n_children) 1274 if (!n_children)
1254 return; 1275 {
1276 evas_object_size_hint_min_set(o, 0, 0);
1277 return;
1278 }
1255 1279
1256 evas_object_geometry_get(o, &x, &y, &w, &h); 1280 evas_object_geometry_get(o, &x, &y, &w, &h);
1257 1281
@@ -1411,7 +1435,10 @@ _box_layout_flow_horizontal(Eo *o, void *_pd, va_list *list EINA_UNUSED)
1411 1435
1412 n_children = eina_list_count(priv->children); 1436 n_children = eina_list_count(priv->children);
1413 if (!n_children) 1437 if (!n_children)
1414 return; 1438 {
1439 evas_object_size_hint_min_set(o, 0, 0);
1440 return;
1441 }
1415 1442
1416 /* *per row* arrays */ 1443 /* *per row* arrays */
1417 row_max_h = (int *)alloca(sizeof(int) * n_children); 1444 row_max_h = (int *)alloca(sizeof(int) * n_children);
@@ -1593,7 +1620,10 @@ _box_layout_flow_vertical(Eo *o, void *_pd, va_list *list EINA_UNUSED)
1593 1620
1594 n_children = eina_list_count(priv->children); 1621 n_children = eina_list_count(priv->children);
1595 if (!n_children) 1622 if (!n_children)
1596 return; 1623 {
1624 evas_object_size_hint_min_set(o, 0, 0);
1625 return;
1626 }
1597 1627
1598 /* *per col* arrays */ 1628 /* *per col* arrays */
1599 col_max_w = (int *)alloca(sizeof(int) * n_children); 1629 col_max_w = (int *)alloca(sizeof(int) * n_children);