From 78b4a9c87909d973f652e1c13dc10ab67ea8055a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Erick=20P=C3=A9rez=20Castellanos?= Date: Thu, 4 Jul 2013 17:12:40 -0400 Subject: [PATCH] gcal-window: improved new-event widget placement --- src/gcal-window.c | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/src/gcal-window.c b/src/gcal-window.c index 8ba9776b..08a0d123 100644 --- a/src/gcal-window.c +++ b/src/gcal-window.c @@ -448,8 +448,10 @@ place_new_event_widget (GtkOverlay *overlay, gpointer user_data) { GcalWindowPrivate *priv; + gint nat_width; gint nat_height; + gint nav_bar_height; priv = gcal_window_get_instance_private (GCAL_WINDOW (user_data)); @@ -463,6 +465,7 @@ place_new_event_widget (GtkOverlay *overlay, nat_width, NULL, &nat_height); + nav_bar_height = gtk_widget_get_allocated_height (priv->nav_bar); g_debug ("[allocate-child] incoming value (%d, %d) - (%d, %d)", allocation->x, @@ -471,8 +474,8 @@ place_new_event_widget (GtkOverlay *overlay, allocation->height); g_debug ("[allocate-child] natural size (%d, %d)", nat_width, nat_height); - allocation->x = priv->event_creation_data->x; - allocation->y = priv->event_creation_data->y; + allocation->x = priv->event_creation_data->x - nat_width / 2; + allocation->y = priv->event_creation_data->y + nav_bar_height - nat_height; allocation->width = nat_width; allocation->height = nat_height;