]> Pileus Git - ~andy/gtk/commitdiff
Handle inverted ranges correctly (#85436, fix from Norihiro UMEDA)
authorOwen Taylor <otaylor@redhat.com>
Tue, 30 Jul 2002 23:17:50 +0000 (23:17 +0000)
committerOwen Taylor <otaylor@src.gnome.org>
Tue, 30 Jul 2002 23:17:50 +0000 (23:17 +0000)
Tue Jul 30 19:09:46 2002  Owen Taylor  <otaylor@redhat.com>

        * gtk/gtkrange.c (gtk_range_scroll_event): Handle
        inverted ranges correctly (#85436, fix from
        Norihiro UMEDA)

ChangeLog
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkrange.c

index 5d8df695477bbca2b875c897668a08cfeb974021..ebb91301c221b3c9c12a60ab62eae6b6d7c19dca 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,9 @@
+Tue Jul 30 19:09:46 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkrange.c (gtk_range_scroll_event): Handle 
+       inverted ranges correctly (#85436, fix from 
+       Norihiro UMEDA)
+
 Tue Jul 30 16:36:53 2002  Owen Taylor  <otaylor@redhat.com>
 
        * tests/testgtk.c: Fix bug in the selection mode option
index 5d8df695477bbca2b875c897668a08cfeb974021..ebb91301c221b3c9c12a60ab62eae6b6d7c19dca 100644 (file)
@@ -1,3 +1,9 @@
+Tue Jul 30 19:09:46 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkrange.c (gtk_range_scroll_event): Handle 
+       inverted ranges correctly (#85436, fix from 
+       Norihiro UMEDA)
+
 Tue Jul 30 16:36:53 2002  Owen Taylor  <otaylor@redhat.com>
 
        * tests/testgtk.c: Fix bug in the selection mode option
index 5d8df695477bbca2b875c897668a08cfeb974021..ebb91301c221b3c9c12a60ab62eae6b6d7c19dca 100644 (file)
@@ -1,3 +1,9 @@
+Tue Jul 30 19:09:46 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkrange.c (gtk_range_scroll_event): Handle 
+       inverted ranges correctly (#85436, fix from 
+       Norihiro UMEDA)
+
 Tue Jul 30 16:36:53 2002  Owen Taylor  <otaylor@redhat.com>
 
        * tests/testgtk.c: Fix bug in the selection mode option
index 5d8df695477bbca2b875c897668a08cfeb974021..ebb91301c221b3c9c12a60ab62eae6b6d7c19dca 100644 (file)
@@ -1,3 +1,9 @@
+Tue Jul 30 19:09:46 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkrange.c (gtk_range_scroll_event): Handle 
+       inverted ranges correctly (#85436, fix from 
+       Norihiro UMEDA)
+
 Tue Jul 30 16:36:53 2002  Owen Taylor  <otaylor@redhat.com>
 
        * tests/testgtk.c: Fix bug in the selection mode option
index 5d8df695477bbca2b875c897668a08cfeb974021..ebb91301c221b3c9c12a60ab62eae6b6d7c19dca 100644 (file)
@@ -1,3 +1,9 @@
+Tue Jul 30 19:09:46 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkrange.c (gtk_range_scroll_event): Handle 
+       inverted ranges correctly (#85436, fix from 
+       Norihiro UMEDA)
+
 Tue Jul 30 16:36:53 2002  Owen Taylor  <otaylor@redhat.com>
 
        * tests/testgtk.c: Fix bug in the selection mode option
index 5d8df695477bbca2b875c897668a08cfeb974021..ebb91301c221b3c9c12a60ab62eae6b6d7c19dca 100644 (file)
@@ -1,3 +1,9 @@
+Tue Jul 30 19:09:46 2002  Owen Taylor  <otaylor@redhat.com>
+
+       * gtk/gtkrange.c (gtk_range_scroll_event): Handle 
+       inverted ranges correctly (#85436, fix from 
+       Norihiro UMEDA)
+
 Tue Jul 30 16:36:53 2002  Owen Taylor  <otaylor@redhat.com>
 
        * tests/testgtk.c: Fix bug in the selection mode option
index 38e6f19908e74f60000f831f9b4db9b002ed2585..e03978fff377933e2e13dd1d721bbb12f06c6f14 100644 (file)
@@ -1360,12 +1360,15 @@ gtk_range_scroll_event (GtkWidget      *widget,
   if (GTK_WIDGET_REALIZED (range))
     {
       GtkAdjustment *adj = GTK_RANGE (range)->adjustment;
-      gdouble new_value = adj->value + ((event->direction == GDK_SCROLL_UP ||
-                                         event->direction == GDK_SCROLL_LEFT) ? 
-                                       -adj->page_increment / 2: 
-                                       adj->page_increment / 2);
-
-      gtk_range_internal_set_value (range, new_value);
+      gdouble increment = ((event->direction == GDK_SCROLL_UP ||
+                           event->direction == GDK_SCROLL_LEFT) ? 
+                          -adj->page_increment / 2: 
+                          adj->page_increment / 2);
+      
+      if (range->inverted)
+       increment = -increment;
+         
+      gtk_range_internal_set_value (range, adj->value + increment);
 
       /* Policy DELAYED makes sense with scroll events,
        * but DISCONTINUOUS doesn't, so we update immediately