mirror of
https://github.com/brl/mutter.git
synced 2024-12-23 19:42:05 +00:00
flow-layout: Fix minimum size request
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.
This commit is contained in:
parent
ba093ed5e7
commit
7195d0fccf
@ -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;
|
||||
|
@ -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)
|
||||
|
Loading…
Reference in New Issue
Block a user