on middle click, center slider on the click.

2001-06-04  Havoc Pennington  <hp@redhat.com>

	* gtk/gtkrange.c (gtk_range_button_press): on middle click, center
	slider on the click.
This commit is contained in:
Havoc Pennington 2001-06-04 19:29:25 +00:00 committed by Havoc Pennington
parent 6a230f1f8b
commit cfdca30ce3
8 changed files with 47 additions and 6 deletions

View File

@ -1,3 +1,8 @@
2001-06-04 Havoc Pennington <hp@redhat.com>
* gtk/gtkrange.c (gtk_range_button_press): on middle click, center
slider on the click.
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case

View File

@ -1,3 +1,8 @@
2001-06-04 Havoc Pennington <hp@redhat.com>
* gtk/gtkrange.c (gtk_range_button_press): on middle click, center
slider on the click.
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case

View File

@ -1,3 +1,8 @@
2001-06-04 Havoc Pennington <hp@redhat.com>
* gtk/gtkrange.c (gtk_range_button_press): on middle click, center
slider on the click.
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case

View File

@ -1,3 +1,8 @@
2001-06-04 Havoc Pennington <hp@redhat.com>
* gtk/gtkrange.c (gtk_range_button_press): on middle click, center
slider on the click.
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case

View File

@ -1,3 +1,8 @@
2001-06-04 Havoc Pennington <hp@redhat.com>
* gtk/gtkrange.c (gtk_range_button_press): on middle click, center
slider on the click.
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case

View File

@ -1,3 +1,8 @@
2001-06-04 Havoc Pennington <hp@redhat.com>
* gtk/gtkrange.c (gtk_range_button_press): on middle click, center
slider on the click.
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case

View File

@ -1,3 +1,8 @@
2001-06-04 Havoc Pennington <hp@redhat.com>
* gtk/gtkrange.c (gtk_range_button_press): on middle click, center
slider on the click.
2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case

View File

@ -922,15 +922,21 @@ gtk_range_button_press (GtkWidget *widget,
*/
if (event->button == 2)
{
gdouble click_value;
click_value = coord_to_value (range,
range->orientation == GTK_ORIENTATION_VERTICAL ?
event->y : event->x);
gdouble slider_low_value, slider_high_value;
slider_high_value =
coord_to_value (range,
range->orientation == GTK_ORIENTATION_VERTICAL ?
event->y : event->x);
slider_low_value =
coord_to_value (range,
range->orientation == GTK_ORIENTATION_VERTICAL ?
event->y - range->layout->slider.height :
event->x - range->layout->slider.width);
/* middle button jumps to point */
gtk_range_internal_set_value (range, click_value);
gtk_range_internal_set_value (range,
slider_low_value + (slider_high_value - slider_low_value) / 2);
/* Calc layout so we can set slide_initial_slider_position
* properly