Permalink
Browse files

ui: video position handled by clutter constraint

  • Loading branch information...
1 parent d3cb8b5 commit 365f0aeccd347e4024894addd3e0afebc9dbd583 @luisbg committed Apr 10, 2012
Showing with 4 additions and 7 deletions.
  1. +4 −7 src/user_interface.c
View
@@ -820,8 +820,6 @@ size_change (ClutterStage * stage,
}
clutter_actor_set_size (CLUTTER_ACTOR (ui->texture), new_width, new_height);
- clutter_actor_set_position (CLUTTER_ACTOR (ui->texture), stage_width / 2,
- stage_height / 2);
update_controls_size (ui);
center_controls (ui);
@@ -1101,6 +1099,10 @@ interface_start (UserInterface * ui, gchar * uri)
// Add video texture and control UI to stage
clutter_container_add (CLUTTER_CONTAINER (ui->stage), ui->texture,
ui->control_box, NULL);
+ clutter_actor_add_constraint (ui->texture,
+ clutter_align_constraint_new (ui->stage, CLUTTER_ALIGN_X_AXIS, 0.5));
+ clutter_actor_add_constraint (ui->texture,
+ clutter_align_constraint_new (ui->stage, CLUTTER_ALIGN_Y_AXIS, 0.5));
clutter_stage_hide_cursor (CLUTTER_STAGE (ui->stage));
clutter_actor_animate (ui->control_box, CLUTTER_EASE_OUT_QUINT, SECOND,
@@ -1111,11 +1113,6 @@ interface_start (UserInterface * ui, gchar * uri)
g_signal_connect (CLUTTER_STAGE (ui->stage), "event", G_CALLBACK (event_cb),
ui);
- clutter_actor_set_anchor_point_from_gravity (CLUTTER_ACTOR (ui->texture),
- CLUTTER_GRAVITY_CENTER);
- clutter_actor_set_position (CLUTTER_ACTOR (ui->texture), ui->stage_width / 2,
- ui->stage_height / 2);
-
center_controls (ui);
progress_timing (ui);

0 comments on commit 365f0ae

Please sign in to comment.