diff options
Diffstat (limited to 'openembedded/packages/gtk+/gtk+-2.10.0/spinbutton.patch')
| -rw-r--r-- | openembedded/packages/gtk+/gtk+-2.10.0/spinbutton.patch | 128 |
1 files changed, 128 insertions, 0 deletions
diff --git a/openembedded/packages/gtk+/gtk+-2.10.0/spinbutton.patch b/openembedded/packages/gtk+/gtk+-2.10.0/spinbutton.patch new file mode 100644 index 0000000000..8ad7507af0 --- /dev/null +++ b/openembedded/packages/gtk+/gtk+-2.10.0/spinbutton.patch | |||
| @@ -0,0 +1,128 @@ | |||
| 1 | --- gtk+-2.4.3/gtk/gtkspinbutton.c.old 2004-04-22 14:49:27.000000000 +0100 | ||
| 2 | +++ gtk+-2.4.3/gtk/gtkspinbutton.c 2004-06-30 21:48:18.000000000 +0100 | ||
| 3 | @@ -733,7 +733,7 @@ | ||
| 4 | |||
| 5 | spin = GTK_SPIN_BUTTON (widget); | ||
| 6 | arrow_size = spin_button_get_arrow_size (spin); | ||
| 7 | - panel_width = arrow_size + 2 * widget->style->xthickness; | ||
| 8 | + panel_width = (2 * arrow_size) + 4 * widget->style->xthickness; | ||
| 9 | |||
| 10 | widget->allocation = *allocation; | ||
| 11 | |||
| 12 | @@ -866,19 +866,16 @@ | ||
| 13 | { | ||
| 14 | width = spin_button_get_arrow_size (spin_button) + 2 * widget->style->xthickness; | ||
| 15 | |||
| 16 | + y = widget->style->ythickness; | ||
| 17 | + height = widget->requisition.height - (2 * y); | ||
| 18 | + | ||
| 19 | if (arrow_type == GTK_ARROW_UP) | ||
| 20 | { | ||
| 21 | x = 0; | ||
| 22 | - y = 0; | ||
| 23 | - | ||
| 24 | - height = widget->requisition.height / 2; | ||
| 25 | } | ||
| 26 | else | ||
| 27 | { | ||
| 28 | - x = 0; | ||
| 29 | - y = widget->requisition.height / 2; | ||
| 30 | - | ||
| 31 | - height = (widget->requisition.height + 1) / 2; | ||
| 32 | + x = width; | ||
| 33 | } | ||
| 34 | |||
| 35 | if (spin_button_at_limit (spin_button, arrow_type)) | ||
| 36 | @@ -908,32 +905,17 @@ | ||
| 37 | shadow_type = GTK_SHADOW_OUT; | ||
| 38 | } | ||
| 39 | } | ||
| 40 | - | ||
| 41 | + | ||
| 42 | gtk_paint_box (widget->style, spin_button->panel, | ||
| 43 | state_type, shadow_type, | ||
| 44 | NULL, widget, | ||
| 45 | - (arrow_type == GTK_ARROW_UP)? "spinbutton_up" : "spinbutton_down", | ||
| 46 | + NULL, | ||
| 47 | x, y, width, height); | ||
| 48 | |||
| 49 | height = widget->requisition.height; | ||
| 50 | |||
| 51 | - if (arrow_type == GTK_ARROW_DOWN) | ||
| 52 | - { | ||
| 53 | - y = height / 2; | ||
| 54 | - height = height - y - 2; | ||
| 55 | - } | ||
| 56 | - else | ||
| 57 | - { | ||
| 58 | - y = 2; | ||
| 59 | - height = height / 2 - 2; | ||
| 60 | - } | ||
| 61 | - | ||
| 62 | width -= 3; | ||
| 63 | - | ||
| 64 | - if (widget && gtk_widget_get_direction (widget) == GTK_TEXT_DIR_RTL) | ||
| 65 | - x = 2; | ||
| 66 | - else | ||
| 67 | - x = 1; | ||
| 68 | + height -= 3; | ||
| 69 | |||
| 70 | w = width / 2; | ||
| 71 | w -= w % 2 - 1; /* force odd */ | ||
| 72 | @@ -1108,7 +1090,7 @@ | ||
| 73 | if (GTK_ENTRY (widget)->editable) | ||
| 74 | gtk_spin_button_update (spin); | ||
| 75 | |||
| 76 | - if (event->y <= widget->requisition.height / 2) | ||
| 77 | + if (event->x <= (spin_button_get_arrow_size (spin) + widget->style->xthickness)) | ||
| 78 | { | ||
| 79 | if (event->button == 1) | ||
| 80 | start_spinning (spin, GTK_ARROW_UP, spin->adjustment->step_increment); | ||
| 81 | @@ -1143,44 +1125,11 @@ | ||
| 82 | |||
| 83 | arrow_size = spin_button_get_arrow_size (spin); | ||
| 84 | |||
| 85 | - if (event->button == spin->button) | ||
| 86 | - { | ||
| 87 | - int click_child = spin->click_child; | ||
| 88 | + gtk_spin_button_stop_spinning (spin); | ||
| 89 | |||
| 90 | - gtk_spin_button_stop_spinning (spin); | ||
| 91 | - | ||
| 92 | - if (event->button == 3) | ||
| 93 | - { | ||
| 94 | - if (event->y >= 0 && event->x >= 0 && | ||
| 95 | - event->y <= widget->requisition.height && | ||
| 96 | - event->x <= arrow_size + 2 * widget->style->xthickness) | ||
| 97 | - { | ||
| 98 | - if (click_child == GTK_ARROW_UP && | ||
| 99 | - event->y <= widget->requisition.height / 2) | ||
| 100 | - { | ||
| 101 | - gdouble diff; | ||
| 102 | - | ||
| 103 | - diff = spin->adjustment->upper - spin->adjustment->value; | ||
| 104 | - if (diff > EPSILON) | ||
| 105 | - gtk_spin_button_real_spin (spin, diff); | ||
| 106 | - } | ||
| 107 | - else if (click_child == GTK_ARROW_DOWN && | ||
| 108 | - event->y > widget->requisition.height / 2) | ||
| 109 | - { | ||
| 110 | - gdouble diff; | ||
| 111 | - | ||
| 112 | - diff = spin->adjustment->value - spin->adjustment->lower; | ||
| 113 | - if (diff > EPSILON) | ||
| 114 | - gtk_spin_button_real_spin (spin, -diff); | ||
| 115 | - } | ||
| 116 | - } | ||
| 117 | - } | ||
| 118 | - spin_button_redraw (spin); | ||
| 119 | + spin_button_redraw (spin); | ||
| 120 | |||
| 121 | - return TRUE; | ||
| 122 | - } | ||
| 123 | - else | ||
| 124 | - return GTK_WIDGET_CLASS (parent_class)->button_release_event (widget, event); | ||
| 125 | + return TRUE; | ||
| 126 | } | ||
| 127 | |||
| 128 | static gint | ||
