gnome-dateedit bug



Hi, 

Can someone please review and commit this patch to libgnomeui. 
Fixes the positioning of the calendar popup in gnome-dateedit 

/Fredrik 


diff -ru libgnomeui/ChangeLog libgnomeui.kopia/ChangeLog
--- libgnomeui/ChangeLog	Thu Jan 17 20:36:02 2002
+++ libgnomeui.kopia/ChangeLog	Sun Jan 20 18:02:10 2002
@@ -1,3 +1,8 @@
+2002-01-20  Fredrik Nilsson  <jymdman home se>
+
+	* libgnomeui/gnome-dateedit.c (position_popup): Fix
+	positioning of the calendar popup.
+
 2002-01-14  Stanislav Visnovsky  <visnovsky nenya ms mff cuni cz>
 
 	* configure.in: added 'sk' to ALL_LINGUAS.
diff -ru libgnomeui/libgnomeui/gnome-dateedit.c libgnomeui.kopia/libgnomeui/gnome-dateedit.c
--- libgnomeui/libgnomeui/gnome-dateedit.c	Sun Jan 20 17:40:10 2002
+++ libgnomeui.kopia/libgnomeui/gnome-dateedit.c	Mon Jan 21 20:36:00 2002
@@ -218,23 +218,27 @@
 position_popup (GnomeDateEdit *gde)
 {
 	gint x, y;
-	gint bwidth, bheight;
 	GtkRequisition req;
 
 	gtk_widget_size_request (gde->_priv->cal_popup, &req);
 
 	gdk_window_get_origin (gde->_priv->date_button->window, &x, &y);
-	gdk_drawable_get_size (gde->_priv->date_button->window, &bwidth, &bheight);
-	
-	x += bwidth - req.width;
-	y += bheight;
+
+	x += gde->_priv->date_button->allocation.x + gde->_priv->date_button->allocation.width - req.width;
+	y += gde->_priv->date_button->allocation.y + gde->_priv->date_button->allocation.height;
+
+	if (x + req.width > gdk_screen_width ())
+		x = gdk_screen_width () - req.width;
 
 	if (x < 0)
 		x = 0;
 
+	if (y + req.height > gdk_screen_height ())
+		y = gdk_screen_height () - req.height;
+	
 	if (y < 0)
 		y = 0;
-	
+
 	gtk_widget_set_uposition (gde->_priv->cal_popup, x, y);
 }
 


[Date Prev][Date Next]   [Thread Prev][Thread Next]   [Thread Index] [Date Index] [Author Index]