Sophie

Sophie

distrib > Mandriva > 2009.0 > i586 > by-pkgid > 9a71895abfb6f490d4fa44e008936a18 > files > 3

gtk+-1.2.10-50mdv2009.0.src.rpm

--- gtk+-1.2.10/gtk/gtkoptionmenu.c.border	Mon Feb 12 21:36:37 2001
+++ gtk+-1.2.10/gtk/gtkoptionmenu.c	Wed Feb 13 18:26:17 2002
@@ -342,30 +342,26 @@
   GtkWidget *child;
   GtkAllocation child_allocation;
   GtkOptionMenuProps props;
+  gint border_width;
     
-  g_return_if_fail (widget != NULL);
-  g_return_if_fail (GTK_IS_OPTION_MENU (widget));
-  g_return_if_fail (allocation != NULL);
-
   gtk_option_menu_get_props (GTK_OPTION_MENU (widget), &props);
+  border_width = GTK_CONTAINER (widget)->border_width;
 
   widget->allocation = *allocation;
   if (GTK_WIDGET_REALIZED (widget))
     gdk_window_move_resize (widget->window,
-			    allocation->x, allocation->y,
-			    allocation->width, allocation->height);
+			    allocation->x + border_width, allocation->y + border_width,
+			    allocation->width - 2 * border_width, allocation->height - 2 * border_width);
 
   child = GTK_BIN (widget)->child;
   if (child && GTK_WIDGET_VISIBLE (child))
     {
-      child_allocation.x = (GTK_CONTAINER (widget)->border_width +
-			    GTK_WIDGET (widget)->style->klass->xthickness) + 1;
-      child_allocation.y = (GTK_CONTAINER (widget)->border_width +
-			    GTK_WIDGET (widget)->style->klass->ythickness) + 1;
-      child_allocation.width = MAX (1, (gint)allocation->width - child_allocation.x * 2 -
+      child_allocation.x = GTK_WIDGET (widget)->style->klass->xthickness + 1;
+      child_allocation.y = GTK_WIDGET (widget)->style->klass->ythickness + 1;
+      child_allocation.width = MAX (1, (gint)allocation->width - child_allocation.x * 2 - border_width * 2 -
 				    props.indicator_width - props.indicator_left_spacing - props.indicator_right_spacing -
 				    CHILD_LEFT_SPACING - CHILD_RIGHT_SPACING - 2);
-      child_allocation.height = MAX (1, (gint)allocation->height - child_allocation.y * 2 -
+      child_allocation.height = MAX (1, (gint)allocation->height - child_allocation.y * 2 - border_width * 2 -
 				     CHILD_TOP_SPACING - CHILD_BOTTOM_SPACING - 2);
       child_allocation.x += CHILD_LEFT_SPACING;
       child_allocation.y += CHILD_TOP_SPACING;
@@ -380,6 +376,7 @@
 {
   GdkRectangle button_area;
   GtkOptionMenuProps props;
+  gint border_width;
 
   g_return_if_fail (widget != NULL);
   g_return_if_fail (GTK_IS_OPTION_MENU (widget));
@@ -388,11 +385,12 @@
   if (GTK_WIDGET_DRAWABLE (widget))
     {
       gtk_option_menu_get_props (GTK_OPTION_MENU (widget), &props);
+      border_width = GTK_CONTAINER (widget)->border_width;
 
-      button_area.x = GTK_CONTAINER (widget)->border_width + 1;
-      button_area.y = GTK_CONTAINER (widget)->border_width + 1;
-      button_area.width = widget->allocation.width - button_area.x * 2;
-      button_area.height = widget->allocation.height - button_area.y * 2;
+      button_area.x = 1;
+      button_area.y = 1;
+      button_area.width = widget->allocation.width - button_area.x * 2 - border_width * 2;
+      button_area.height = widget->allocation.height - button_area.y * 2 - border_width * 2;
 
       /* This is evil, and should be elimated here and in the button
        * code. The point is to clear the focus, and make it