forked from AuroraMiddleware/gtk
make motion around the ring much slower but finer-grained (gtk_hsv_focus):
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
This commit is contained in:
parent
207e3bb977
commit
891cd55ee3
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
@ -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
|
||||
|
16
gtk/gtkhsv.c
16
gtk/gtkhsv.c
@ -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;
|
||||
}
|
||||
@ -1664,11 +1669,12 @@ 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);
|
||||
}
|
||||
|
||||
|
@ -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;
|
||||
|
@ -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;
|
||||
|
Loading…
Reference in New Issue
Block a user