summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorLuis de Bethencourt <luis@debethencourt.com>2011-03-20 22:18:37 +0100
committerLuis de Bethencourt <luis@debethencourt.com>2011-03-20 22:18:37 +0100
commitfea2a121afe41c74d56bf338fc150fd1be902799 (patch)
treef3311c6c098771a26a92d403533a35b0abf218bf
parent33b0eabc8f25e38b87f96e6b051867a144f9ae35 (diff)
ui: controls position adjusted for not-tall videos0.1_rc
-rw-r--r--src/user_interface.c12
1 files changed, 10 insertions, 2 deletions
diff --git a/src/user_interface.c b/src/user_interface.c
index 12f7bb9..42fd09d 100644
--- a/src/user_interface.c
+++ b/src/user_interface.c
@@ -50,10 +50,18 @@ static void update_controls_size (UserInterface * ui);
static void
center_controls (UserInterface * ui)
{
- gfloat x, y;
+ gfloat x, y, third_vh, diff;
+ third_vh = ui->stage_height / 3;
x = (ui->stage_width - clutter_actor_get_width (ui->control_box)) / 2;
- y = ui->stage_height - (ui->stage_height / 3);
+ y = ui->stage_height - third_vh;
+
+ third_vh -= CTL_SPACING;
+ if (clutter_actor_get_height (ui->control_box) > third_vh)
+ {
+ diff = clutter_actor_get_height (ui->control_box) - third_vh;
+ y -= diff;
+ }
clutter_actor_set_position (ui->control_box, x, y);
}