diff options
Diffstat (limited to 'meta/packages/gtk+/gtk+-2.10.10/spinbutton.patch')
-rw-r--r-- | meta/packages/gtk+/gtk+-2.10.10/spinbutton.patch | 130 |
1 files changed, 130 insertions, 0 deletions
diff --git a/meta/packages/gtk+/gtk+-2.10.10/spinbutton.patch b/meta/packages/gtk+/gtk+-2.10.10/spinbutton.patch new file mode 100644 index 0000000000..c26dc6d93c --- /dev/null +++ b/meta/packages/gtk+/gtk+-2.10.10/spinbutton.patch | |||
@@ -0,0 +1,130 @@ | |||
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 | ||
6 | |||
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; | ||
11 | |||
12 | widget->allocation = *allocation; | ||
13 | |||
14 | @@ -815,19 +815,16 @@ gtk_spin_button_draw_arrow (GtkSpinButto | ||
15 | { | ||
16 | width = spin_button_get_arrow_size (spin_button) + 2 * widget->style->xthickness; | ||
17 | |||
18 | + y = widget->style->ythickness; | ||
19 | + height = widget->requisition.height - (2 * y); | ||
20 | + | ||
21 | if (arrow_type == GTK_ARROW_UP) | ||
22 | { | ||
23 | x = 0; | ||
24 | - y = 0; | ||
25 | - | ||
26 | - height = widget->requisition.height / 2; | ||
27 | } | ||
28 | else | ||
29 | { | ||
30 | - x = 0; | ||
31 | - y = widget->requisition.height / 2; | ||
32 | - | ||
33 | - height = (widget->requisition.height + 1) / 2; | ||
34 | + x = width; | ||
35 | } | ||
36 | |||
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; | ||
40 | } | ||
41 | } | ||
42 | - | ||
43 | + | ||
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); | ||
50 | |||
51 | height = widget->requisition.height; | ||
52 | |||
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 | - } | ||
63 | - | ||
64 | width -= 3; | ||
65 | - | ||
66 | - if (widget && gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) | ||
67 | - x = 2; | ||
68 | - else | ||
69 | - x = 1; | ||
70 | + height -= 3; | ||
71 | |||
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); | ||
77 | |||
78 | - if (event->y <= widget->requisition.height / 2) | ||
79 | + if (event->x <= (spin_button_get_arrow_size (spin) + widget->style->xthickness)) | ||
80 | { | ||
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 | ||
84 | |||
85 | arrow_size = spin_button_get_arrow_size (spin); | ||
86 | |||
87 | - if (event->button == spin->button) | ||
88 | - { | ||
89 | - int click_child = spin->click_child; | ||
90 | + gtk_spin_button_stop_spinning (spin); | ||
91 | |||
92 | - gtk_spin_button_stop_spinning (spin); | ||
93 | - | ||
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) | ||
102 | - { | ||
103 | - gdouble diff; | ||
104 | - | ||
105 | - diff = spin->adjustment->upper - spin->adjustment->value; | ||
106 | - if (diff > EPSILON) | ||
107 | - gtk_spin_button_real_spin (spin, diff); | ||
108 | - } | ||
109 | - else if (click_child == GTK_ARROW_DOWN && | ||
110 | - event->y > widget->requisition.height / 2) | ||
111 | - { | ||
112 | - gdouble diff; | ||
113 | - | ||
114 | - diff = spin->adjustment->value - spin->adjustment->lower; | ||
115 | - if (diff > EPSILON) | ||
116 | - gtk_spin_button_real_spin (spin, -diff); | ||
117 | - } | ||
118 | - } | ||
119 | - } | ||
120 | - spin_button_redraw (spin); | ||
121 | + spin_button_redraw (spin); | ||
122 | |||
123 | - return TRUE; | ||
124 | - } | ||
125 | - else | ||
126 | - return GTK_WIDGET_CLASS (gtk_spin_button_parent_class)->button_release_event (widget, event); | ||
127 | + return TRUE; | ||
128 | } | ||
129 | |||
130 | static gint | ||