bump version
[buildroot.git] / package / libgtk2 / spinbutton.patch
blobc26dc6d93caefd264da69020c68a8b134eb97f61
1 Index: gtk+-2.10.6/gtk/gtkspinbutton.c
2 ===================================================================
3 --- gtk+-2.10.6.orig/gtk/gtkspinbutton.c
4 +++ gtk+-2.10.6/gtk/gtkspinbutton.c
5 @@ -682,7 +682,7 @@ gtk_spin_button_size_allocate (GtkWidget
7 spin = GTK_SPIN_BUTTON (widget);
8 arrow_size = spin_button_get_arrow_size (spin);
9 - panel_width = arrow_size + 2 * widget->style->xthickness;
10 + panel_width = (2 * arrow_size) + 4 * widget->style->xthickness;
12 widget->allocation = *allocation;
14 @@ -815,19 +815,16 @@ gtk_spin_button_draw_arrow (GtkSpinButto
16 width = spin_button_get_arrow_size (spin_button) + 2 * widget->style->xthickness;
18 + y = widget->style->ythickness;
19 + height = widget->requisition.height - (2 * y);
21 if (arrow_type == GTK_ARROW_UP)
23 x = 0;
24 - y = 0;
26 - height = widget->requisition.height / 2;
28 else
30 - x = 0;
31 - y = widget->requisition.height / 2;
33 - height = (widget->requisition.height + 1) / 2;
34 + x = width;
37 if (spin_button_at_limit (spin_button, arrow_type))
38 @@ -857,32 +854,17 @@ gtk_spin_button_draw_arrow (GtkSpinButto
39 shadow_type = GTK_SHADOW_OUT;
44 gtk_paint_box (widget->style, spin_button->panel,
45 state_type, shadow_type,
46 NULL, widget,
47 - (arrow_type == GTK_ARROW_UP)? "spinbutton_up" : "spinbutton_down",
48 + NULL,
49 x, y, width, height);
51 height = widget->requisition.height;
53 - if (arrow_type == GTK_ARROW_DOWN)
54 - {
55 - y = height / 2;
56 - height = height - y - 2;
57 - }
58 - else
59 - {
60 - y = 2;
61 - height = height / 2 - 2;
62 - }
64 width -= 3;
66 - if (widget && gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL)
67 - x = 2;
68 - else
69 - x = 1;
70 + height -= 3;
72 w = width / 2;
73 w -= w % 2 - 1; /* force odd */
74 @@ -1062,7 +1044,7 @@ gtk_spin_button_button_press (GtkWidget
75 if (GTK_ENTRY (widget)->editable)
76 gtk_spin_button_update (spin);
78 - if (event->y <= widget->requisition.height / 2)
79 + if (event->x <= (spin_button_get_arrow_size (spin) + widget->style->xthickness))
81 if (event->button == 1)
82 start_spinning (spin, GTK_ARROW_UP, spin->adjustment->step_increment);
83 @@ -1097,44 +1079,11 @@ gtk_spin_button_button_release (GtkWidge
85 arrow_size = spin_button_get_arrow_size (spin);
87 - if (event->button == spin->button)
88 - {
89 - int click_child = spin->click_child;
90 + gtk_spin_button_stop_spinning (spin);
92 - gtk_spin_button_stop_spinning (spin);
94 - if (event->button == 3)
95 - {
96 - if (event->y >= 0 && event->x >= 0 &&
97 - event->y <= widget->requisition.height &&
98 - event->x <= arrow_size + 2 * widget->style->xthickness)
99 - {
100 - if (click_child == GTK_ARROW_UP &&
101 - event->y <= widget->requisition.height / 2)
103 - gdouble diff;
105 - diff = spin->adjustment->upper - spin->adjustment->value;
106 - if (diff > EPSILON)
107 - gtk_spin_button_real_spin (spin, diff);
109 - else if (click_child == GTK_ARROW_DOWN &&
110 - event->y > widget->requisition.height / 2)
112 - gdouble diff;
114 - diff = spin->adjustment->value - spin->adjustment->lower;
115 - if (diff > EPSILON)
116 - gtk_spin_button_real_spin (spin, -diff);
119 - }
120 - spin_button_redraw (spin);
121 + spin_button_redraw (spin);
123 - return TRUE;
125 - else
126 - return GTK_WIDGET_CLASS (gtk_spin_button_parent_class)->button_release_event (widget, event);
127 + return TRUE;
130 static gint