[gnome-calendar/ui-rewrite] gcal-window: improved new-event widget placement
- From: Erick Pérez Castellanos <erickpc src gnome org>
- To: commits-list gnome org
- Cc:
- Subject: [gnome-calendar/ui-rewrite] gcal-window: improved new-event widget placement
- Date: Mon, 29 Jul 2013 17:37:13 +0000 (UTC)
commit 599059099cc34a47c9fee5f72c6674a82c08f272
Author: Erick Pérez Castellanos <erick red gmail com>
Date: Thu Jul 4 17:12:40 2013 -0400
gcal-window: improved new-event widget placement
src/gcal-window.c | 7 +++++--
1 files changed, 5 insertions(+), 2 deletions(-)
---
diff --git a/src/gcal-window.c b/src/gcal-window.c
index 8ba9776..08a0d12 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;
[
Date Prev][
Date Next] [
Thread Prev][
Thread Next]
[
Thread Index]
[
Date Index]
[
Author Index]