mirror of
https://gitlab.gnome.org/GNOME/gtk.git
synced 2024-11-10 10:50:10 +00:00
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:
parent
6a230f1f8b
commit
cfdca30ce3
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
Loading…
Reference in New Issue
Block a user