flow-layout: Fix minimum size request
authorEmmanuele Bassi <ebassi@linux.intel.com>
Mon, 5 Dec 2011 10:25:42 +0000 (10:25 +0000)
committerEmmanuele Bassi <ebassi@gnome.org>
Mon, 16 Jan 2012 23:35:16 +0000 (23:35 +0000)
The minimum preferred size of a Flow layout manager is the size of a
column or a row, as the whole point of the layout policy enforced by
the Flow layout manager is to reflow when needed.

clutter/clutter-flow-layout.c
tests/interactive/test-flow-layout.c

index b1d9ac5..0f97f76 100644 (file)
@@ -365,7 +365,7 @@ clutter_flow_layout_get_preferred_width (ClutterLayoutManager *manager,
   priv->req_height = for_height;
 
   if (min_width_p)
-    *min_width_p = total_min_width;
+    *min_width_p = max_min_width;
 
   if (nat_width_p)
     *nat_width_p = total_natural_width;
@@ -542,7 +542,7 @@ clutter_flow_layout_get_preferred_height (ClutterLayoutManager *manager,
   priv->req_width = for_width;
 
   if (min_height_p)
-    *min_height_p = total_min_height;
+    *min_height_p = max_min_height;
 
   if (nat_height_p)
     *nat_height_p = total_natural_height;
index f055054..fa42583 100644 (file)
@@ -72,8 +72,6 @@ test_flow_layout_main (int argc, char *argv[])
 {
   ClutterActor *stage, *box;
   ClutterLayoutManager *layout;
-  ClutterColor stage_color = { 0xe0, 0xf2, 0xfc, 0xff };
-  ClutterColor box_color = { 255, 255, 255, 255 };
   GError *error;
   gint i;
 
@@ -92,7 +90,7 @@ test_flow_layout_main (int argc, char *argv[])
 
   stage = clutter_stage_new ();
   clutter_stage_set_title (CLUTTER_STAGE (stage), "Flow Layout");
-  clutter_stage_set_color (CLUTTER_STAGE (stage), &stage_color);
+  clutter_stage_set_color (CLUTTER_STAGE (stage), CLUTTER_COLOR_LightSkyBlue);
   clutter_stage_set_user_resizable (CLUTTER_STAGE (stage), TRUE);
   g_signal_connect (stage, "destroy", G_CALLBACK (clutter_main_quit), NULL);
 
@@ -106,7 +104,7 @@ test_flow_layout_main (int argc, char *argv[])
                                        y_spacing);
 
   box = clutter_box_new (layout);
-  clutter_box_set_color (CLUTTER_BOX (box), &box_color);
+  clutter_box_set_color (CLUTTER_BOX (box), CLUTTER_COLOR_Aluminium2);
   clutter_container_add_actor (CLUTTER_CONTAINER (stage), box);
 
   if (!fixed_size)