From f75dfcfd8b2e17862614eb6e0722a61c34e0dcde Mon Sep 17 00:00:00 2001 From: Emmanuele Bassi Date: Sat, 15 Oct 2011 18:35:45 +0100 Subject: [PATCH] interactive: Use the newly added CLUTTER_ALIGN_BOTH value We center a lot of stuff using ClutterAlignConstraints. --- tests/interactive/test-actors.c | 3 +-- tests/interactive/test-constraints.c | 7 ++----- tests/interactive/test-scrolling.c | 3 +-- tests/interactive/test-snap-constraint.c | 3 +-- tests/interactive/test-state-script.c | 3 +-- 5 files changed, 6 insertions(+), 13 deletions(-) diff --git a/tests/interactive/test-actors.c b/tests/interactive/test-actors.c index f3d7b23..4ce782a 100644 --- a/tests/interactive/test-actors.c +++ b/tests/interactive/test-actors.c @@ -216,8 +216,7 @@ test_actors_main (int argc, char *argv[]) oh->group = clutter_group_new(); clutter_actor_set_name (oh->group, "Group"); g_signal_connect (oh->group, "destroy", G_CALLBACK (on_group_destroy), oh); - clutter_actor_add_constraint (oh->group, clutter_align_constraint_new (stage, CLUTTER_ALIGN_X_AXIS, 0.5)); - clutter_actor_add_constraint (oh->group, clutter_align_constraint_new (stage, CLUTTER_ALIGN_Y_AXIS, 0.5)); + clutter_actor_add_constraint (oh->group, clutter_align_constraint_new (stage, CLUTTER_ALIGN_BOTH, 0.5)); clutter_actor_add_constraint (oh->group, clutter_bind_constraint_new (stage, CLUTTER_BIND_SIZE, 0.0f)); oh->hand = g_new (ClutterActor*, n_hands); diff --git a/tests/interactive/test-constraints.c b/tests/interactive/test-constraints.c index 3e45ce9..0c6a54f 100644 --- a/tests/interactive/test-constraints.c +++ b/tests/interactive/test-constraints.c @@ -186,11 +186,8 @@ test_constraints_main (int argc, char *argv[]) clutter_container_add_actor (CLUTTER_CONTAINER (stage), rect); /* align the center rectangle to the center of the stage */ - constraint = clutter_align_constraint_new (stage, CLUTTER_ALIGN_X_AXIS, 0.5); - clutter_actor_add_constraint_with_name (rect, "x-align", constraint); - - constraint = clutter_align_constraint_new (stage, CLUTTER_ALIGN_Y_AXIS, 0.5); - clutter_actor_add_constraint_with_name (rect, "y-align", constraint); + constraint = clutter_align_constraint_new (stage, CLUTTER_ALIGN_BOTH, 0.5); + clutter_actor_add_constraint_with_name (rect, "align", constraint); /* this is the equivalent of the DesaturateEffect; we cannot animate * the factor because the animation API only understands GObject diff --git a/tests/interactive/test-scrolling.c b/tests/interactive/test-scrolling.c index 73ba63a..9699d55 100644 --- a/tests/interactive/test-scrolling.c +++ b/tests/interactive/test-scrolling.c @@ -88,8 +88,7 @@ test_scrolling_main (int argc, char *argv[]) scroll = clutter_group_new (); clutter_container_add_actor (CLUTTER_CONTAINER (stage), scroll); clutter_actor_set_size (scroll, RECT_WIDTH, RECT_HEIGHT); - clutter_actor_add_constraint (scroll, clutter_align_constraint_new (stage, CLUTTER_ALIGN_X_AXIS, 0.5)); - clutter_actor_add_constraint (scroll, clutter_align_constraint_new (stage, CLUTTER_ALIGN_Y_AXIS, 0.5)); + clutter_actor_add_constraint (scroll, clutter_align_constraint_new (stage, CLUTTER_ALIGN_BOTH, 0.5)); clutter_actor_set_clip_to_allocation (scroll, TRUE); /* viewport: the actual container for the children; we scroll it using diff --git a/tests/interactive/test-snap-constraint.c b/tests/interactive/test-snap-constraint.c index 6ca4e33..e36350c 100644 --- a/tests/interactive/test-snap-constraint.c +++ b/tests/interactive/test-snap-constraint.c @@ -27,8 +27,7 @@ test_snap_constraint_main (int argc, clutter_actor_set_size (layer_a, 100.0, 25.0); /* the first layer is anchored to the middle of the stage */ - clutter_actor_add_constraint (layer_a, clutter_align_constraint_new (stage, CLUTTER_ALIGN_X_AXIS, 0.5)); - clutter_actor_add_constraint (layer_a, clutter_align_constraint_new (stage, CLUTTER_ALIGN_Y_AXIS, 0.5)); + clutter_actor_add_constraint (layer_a, clutter_align_constraint_new (stage, CLUTTER_ALIGN_BOTH, 0.5)); /* second layer, with no implicit size */ layer_b = clutter_rectangle_new_with_color (CLUTTER_COLOR_DarkButter); diff --git a/tests/interactive/test-state-script.c b/tests/interactive/test-state-script.c index 276cd85..e777d89 100644 --- a/tests/interactive/test-state-script.c +++ b/tests/interactive/test-state-script.c @@ -41,8 +41,7 @@ test_state_script_main (int argc, char *argv[]) button = CLUTTER_ACTOR (clutter_script_get_object (script, "button")); clutter_container_add_actor (CLUTTER_CONTAINER (stage), button); - clutter_actor_add_constraint (button, clutter_align_constraint_new (stage, CLUTTER_ALIGN_X_AXIS, 0.5)); - clutter_actor_add_constraint (button, clutter_align_constraint_new (stage, CLUTTER_ALIGN_Y_AXIS, 0.5)); + clutter_actor_add_constraint (button, clutter_align_constraint_new (stage, CLUTTER_ALIGN_BOTH, 0.5)); clutter_script_connect_signals (script, NULL); -- 2.7.4