summaryrefslogtreecommitdiffstats
path: root/x11-libs/gtk+/files/gtk+-1.2.10-cvs-border.patch
blob: c165f7a270f0442ba793d24f40b8783d0ae22355 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
--- 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