summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorEmmanuele Bassi <ebassi@gnome.org>2011-10-15 18:35:45 +0100
committerEmmanuele Bassi <ebassi@gnome.org>2011-10-15 18:36:27 +0100
commitf75dfcfd8b2e17862614eb6e0722a61c34e0dcde (patch)
tree4112af0737cf82c41d1dbadbe9f2e0592510ed5e
parent1e51961f7a19c4c2ddca1ad75e6bbae12d51bbbb (diff)
downloadclutter-f75dfcfd8b2e17862614eb6e0722a61c34e0dcde.tar.gz
interactive: Use the newly added CLUTTER_ALIGN_BOTH value
We center a lot of stuff using ClutterAlignConstraints.
-rw-r--r--tests/interactive/test-actors.c3
-rw-r--r--tests/interactive/test-constraints.c7
-rw-r--r--tests/interactive/test-scrolling.c3
-rw-r--r--tests/interactive/test-snap-constraint.c3
-rw-r--r--tests/interactive/test-state-script.c3
5 files changed, 6 insertions, 13 deletions
diff --git a/tests/interactive/test-actors.c b/tests/interactive/test-actors.c
index f3d7b2348..4ce782aeb 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 3e45ce990..0c6a54f8b 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 73ba63ae2..9699d554c 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 6ca4e3303..e36350cbc 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 276cd85ff..e777d89bc 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);