Commit cfdca30c authored by Havoc Pennington's avatar Havoc Pennington Committed by Havoc Pennington

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.
parent 6a230f1f
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> 2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case * gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
......
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> 2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case * gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
......
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> 2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case * gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
......
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> 2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case * gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
......
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> 2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case * gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
......
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> 2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case * gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
......
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> 2001-06-03 Havoc Pennington <hp@pobox.com>
* gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case * gtk/gtkstyle.c (gtk_default_draw_slider): make this special-case
......
...@@ -922,15 +922,21 @@ gtk_range_button_press (GtkWidget *widget, ...@@ -922,15 +922,21 @@ gtk_range_button_press (GtkWidget *widget,
*/ */
if (event->button == 2) if (event->button == 2)
{ {
gdouble click_value; gdouble slider_low_value, slider_high_value;
click_value = coord_to_value (range,
range->orientation == GTK_ORIENTATION_VERTICAL ?
event->y : event->x);
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 */ /* 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 /* Calc layout so we can set slide_initial_slider_position
* properly * properly
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment