]> Pileus Git - ~andy/gtk/commitdiff
make motion around the ring much slower but finer-grained (gtk_hsv_focus):
authorHavoc Pennington <hp@pobox.com>
Sat, 24 Mar 2001 06:41:28 +0000 (06:41 +0000)
committerHavoc Pennington <hp@src.gnome.org>
Sat, 24 Mar 2001 06:41:28 +0000 (06:41 +0000)
2001-03-24  Havoc Pennington  <hp@pobox.com>

* gtk/gtkhsv.c (gtk_hsv_move): make motion around the ring much
slower but finer-grained
(gtk_hsv_focus): get initial focus on the ring or triangle
according to tab direction

* gtk/testgtk.c (main): get rid of weird sleep(1) on exit

ChangeLog
ChangeLog.pre-2-0
ChangeLog.pre-2-10
ChangeLog.pre-2-2
ChangeLog.pre-2-4
ChangeLog.pre-2-6
ChangeLog.pre-2-8
gtk/gtkhsv.c
gtk/testgtk.c
tests/testgtk.c

index 4a9a13e5b07fbf38d1745aa9ee7435deea5f7d55..578d62746398cd09059683863ce1c1aba7065f99 100644 (file)
--- a/ChangeLog
+++ b/ChangeLog
@@ -1,3 +1,12 @@
+2001-03-24  Havoc Pennington  <hp@pobox.com>
+
+       * gtk/gtkhsv.c (gtk_hsv_move): make motion around the ring much
+       slower but finer-grained
+       (gtk_hsv_focus): get initial focus on the ring or triangle 
+       according to tab direction
+
+       * gtk/testgtk.c (main): get rid of weird sleep(1) on exit
+
 2001-03-23  Havoc Pennington  <hp@pobox.com>
 
        * gtk/gtkhsv.c: make this somewhat key-navigable
index 4a9a13e5b07fbf38d1745aa9ee7435deea5f7d55..578d62746398cd09059683863ce1c1aba7065f99 100644 (file)
@@ -1,3 +1,12 @@
+2001-03-24  Havoc Pennington  <hp@pobox.com>
+
+       * gtk/gtkhsv.c (gtk_hsv_move): make motion around the ring much
+       slower but finer-grained
+       (gtk_hsv_focus): get initial focus on the ring or triangle 
+       according to tab direction
+
+       * gtk/testgtk.c (main): get rid of weird sleep(1) on exit
+
 2001-03-23  Havoc Pennington  <hp@pobox.com>
 
        * gtk/gtkhsv.c: make this somewhat key-navigable
index 4a9a13e5b07fbf38d1745aa9ee7435deea5f7d55..578d62746398cd09059683863ce1c1aba7065f99 100644 (file)
@@ -1,3 +1,12 @@
+2001-03-24  Havoc Pennington  <hp@pobox.com>
+
+       * gtk/gtkhsv.c (gtk_hsv_move): make motion around the ring much
+       slower but finer-grained
+       (gtk_hsv_focus): get initial focus on the ring or triangle 
+       according to tab direction
+
+       * gtk/testgtk.c (main): get rid of weird sleep(1) on exit
+
 2001-03-23  Havoc Pennington  <hp@pobox.com>
 
        * gtk/gtkhsv.c: make this somewhat key-navigable
index 4a9a13e5b07fbf38d1745aa9ee7435deea5f7d55..578d62746398cd09059683863ce1c1aba7065f99 100644 (file)
@@ -1,3 +1,12 @@
+2001-03-24  Havoc Pennington  <hp@pobox.com>
+
+       * gtk/gtkhsv.c (gtk_hsv_move): make motion around the ring much
+       slower but finer-grained
+       (gtk_hsv_focus): get initial focus on the ring or triangle 
+       according to tab direction
+
+       * gtk/testgtk.c (main): get rid of weird sleep(1) on exit
+
 2001-03-23  Havoc Pennington  <hp@pobox.com>
 
        * gtk/gtkhsv.c: make this somewhat key-navigable
index 4a9a13e5b07fbf38d1745aa9ee7435deea5f7d55..578d62746398cd09059683863ce1c1aba7065f99 100644 (file)
@@ -1,3 +1,12 @@
+2001-03-24  Havoc Pennington  <hp@pobox.com>
+
+       * gtk/gtkhsv.c (gtk_hsv_move): make motion around the ring much
+       slower but finer-grained
+       (gtk_hsv_focus): get initial focus on the ring or triangle 
+       according to tab direction
+
+       * gtk/testgtk.c (main): get rid of weird sleep(1) on exit
+
 2001-03-23  Havoc Pennington  <hp@pobox.com>
 
        * gtk/gtkhsv.c: make this somewhat key-navigable
index 4a9a13e5b07fbf38d1745aa9ee7435deea5f7d55..578d62746398cd09059683863ce1c1aba7065f99 100644 (file)
@@ -1,3 +1,12 @@
+2001-03-24  Havoc Pennington  <hp@pobox.com>
+
+       * gtk/gtkhsv.c (gtk_hsv_move): make motion around the ring much
+       slower but finer-grained
+       (gtk_hsv_focus): get initial focus on the ring or triangle 
+       according to tab direction
+
+       * gtk/testgtk.c (main): get rid of weird sleep(1) on exit
+
 2001-03-23  Havoc Pennington  <hp@pobox.com>
 
        * gtk/gtkhsv.c: make this somewhat key-navigable
index 4a9a13e5b07fbf38d1745aa9ee7435deea5f7d55..578d62746398cd09059683863ce1c1aba7065f99 100644 (file)
@@ -1,3 +1,12 @@
+2001-03-24  Havoc Pennington  <hp@pobox.com>
+
+       * gtk/gtkhsv.c (gtk_hsv_move): make motion around the ring much
+       slower but finer-grained
+       (gtk_hsv_focus): get initial focus on the ring or triangle 
+       according to tab direction
+
+       * gtk/testgtk.c (main): get rid of weird sleep(1) on exit
+
 2001-03-23  Havoc Pennington  <hp@pobox.com>
 
        * gtk/gtkhsv.c: make this somewhat key-navigable
index 654c1c0aee146608597e94b8925f6ebac8bb2403..cc84b563bf93f38e2a6e3665f6d9e02a51d462c6 100644 (file)
@@ -1363,6 +1363,11 @@ gtk_hsv_focus (GtkContainer    *container,
 
   if (!GTK_WIDGET_HAS_FOCUS (hsv))
     {
+      if (dir == GTK_DIR_TAB_BACKWARD)
+        priv->focus_on_ring = FALSE;
+      else
+        priv->focus_on_ring = TRUE;
+
       gtk_widget_grab_focus (GTK_WIDGET (hsv));
       return TRUE;
     }
@@ -1663,12 +1668,13 @@ gtk_hsv_move (GtkHSV          *hsv,
 
   x = floor (sx + (vx - sx) * priv->v + (hx - vx) * priv->s * priv->v + 0.5);
   y = floor (sy + (vy - sy) * priv->v + (hy - vy) * priv->s * priv->v + 0.5);
-  
+
+#define HUE_DELTA 0.002
   switch (dir)
     {
     case GTK_DIR_UP:
       if (priv->focus_on_ring)
-        hue += 0.02;
+        hue += HUE_DELTA;
       else
         {
           y -= 1;
@@ -1678,7 +1684,7 @@ gtk_hsv_move (GtkHSV          *hsv,
 
     case GTK_DIR_DOWN:
       if (priv->focus_on_ring)
-        hue -= 0.02;
+        hue -= HUE_DELTA;
       else
         {
           y += 1;
@@ -1688,7 +1694,7 @@ gtk_hsv_move (GtkHSV          *hsv,
 
     case GTK_DIR_LEFT:
       if (priv->focus_on_ring)
-        hue += 0.02;
+        hue += HUE_DELTA;
       else
         {
           x -= 1;
@@ -1698,7 +1704,8 @@ gtk_hsv_move (GtkHSV          *hsv,
 
     case GTK_DIR_RIGHT:
       if (priv->focus_on_ring)
-        hue -= 0.02;
+        hue -= HUE_DELTA
+          ;
       else
         {
           x += 1;
@@ -1719,3 +1726,4 @@ gtk_hsv_move (GtkHSV          *hsv,
   
   gtk_hsv_set_color (hsv, hue, sat, val);
 }
+
index e4632db39e46e1ed4a9d4d0196b46ae8aede9097..d1ebb32f90db6b8db7844cacff4579e04eab55f6 100644 (file)
@@ -9990,9 +9990,11 @@ main (int argc, char *argv[])
     {
       while (g_main_pending ())
        g_main_iteration (FALSE);
+#if 0
       sleep (1);
       while (g_main_pending ())
        g_main_iteration (FALSE);
+#endif
     }
 
   return 0;
index e4632db39e46e1ed4a9d4d0196b46ae8aede9097..d1ebb32f90db6b8db7844cacff4579e04eab55f6 100644 (file)
@@ -9990,9 +9990,11 @@ main (int argc, char *argv[])
     {
       while (g_main_pending ())
        g_main_iteration (FALSE);
+#if 0
       sleep (1);
       while (g_main_pending ())
        g_main_iteration (FALSE);
+#endif
     }
 
   return 0;