Enlightenment CVS committal
Author : rbdpngn
Project : e17
Module : libs/ewl
Dir : e17/libs/ewl/src
Modified Files:
ewl_spinner.c
Log Message:
Use a slightly modified function for adjusting the value over time. This
allows for incrementing single values at a time.
===================================================================
RCS file: /cvsroot/enlightenment/e17/libs/ewl/src/ewl_spinner.c,v
retrieving revision 1.50
retrieving revision 1.51
diff -u -3 -r1.50 -r1.51
--- ewl_spinner.c 16 May 2004 05:48:17 -0000 1.50
+++ ewl_spinner.c 16 May 2004 21:42:57 -0000 1.51
@@ -560,8 +560,8 @@
{
Ewl_Spinner *s;
double dt;
- double value, range;
- int velocity;
+ double value, range, tmpt;
+ int velocity, delay;
s = EWL_SPINNER(data);
@@ -580,11 +580,24 @@
velocity = 10;
/*
+ * Check the theme for a delay setting and bring it within normal
+ * useable bounds.
+ */
+ delay = ewl_theme_data_get_int(EWL_WIDGET(s), "delay");
+ if (delay < 1)
+ delay = 1;
+ else if (delay > 10)
+ delay = 10;
+
+ /*
* Move the value of the spinner based on the direction of it's motion
* and the velocity setting.
*/
- value += ((double)(s->direction) * (1 - exp(-dt)) *
- ((double)(velocity) / 100.0)) * range;
+ tmpt = (dt > (double)delay ? dt - (double)delay : 0.0);
+ printf("Delay: %g\n", tmpt);
+ tmpt = ((1 - exp(-tmpt)) * ((double)(velocity) / 100.0)) * range;
+ printf("\tDelay: %g\n", tmpt);
+ value += (double)(s->direction) * ((1 - exp(-dt)) + tmpt);
ewl_spinner_set_value(s, value);
-------------------------------------------------------
This SF.Net email is sponsored by: SourceForge.net Broadband
Sign-up now for SourceForge Broadband and get the fastest
6.0/768 connection for only $19.95/mo for the first 3 months!
http://ads.osdn.com/?ad_id=2562&alloc_id=6184&op=click
_______________________________________________
enlightenment-cvs mailing list
[EMAIL PROTECTED]
https://lists.sourceforge.net/lists/listinfo/enlightenment-cvs