[Pychord-commits] r48 - in trunk: pgui pychord2

danilo at garage.maemo.org danilo at garage.maemo.org
Sun Mar 9 15:38:18 EET 2008


Author: danilo
Date: 2008-03-09 15:38:18 +0200 (Sun, 09 Mar 2008)
New Revision: 48

Modified:
   trunk/pgui/list.py
   trunk/pgui/locale.py
   trunk/pychord2/main_window.py
Log:
- Improving lists speed system

Modified: trunk/pgui/list.py
===================================================================
--- trunk/pgui/list.py	2008-03-09 13:13:52 UTC (rev 47)
+++ trunk/pgui/list.py	2008-03-09 13:38:18 UTC (rev 48)
@@ -36,14 +36,15 @@
         if self.clicked:
             pos = pygame.mouse.get_rel()
             self.move(pos[1])
+            
+            
         elif self.autoScrollEnabled:
-            self.speedAux += 1
-            
-            if self.speedAux == 1:
-                self.move(-2)
-                
-            elif self.speedAux > pguiListMaximumSpeed - self.autoScrollSpeed:
+            moveFactor = (1 + self.autoScrollSpeed/pguiListMaximumSpeed )
+            self.speedAux += moveFactor
+      
+            if self.speedAux > moveFactor*pguiListMaximumSpeed - self.autoScrollSpeed:
                 self.speedAux = 0
+                self.move(-moveFactor)  
                 
         container.update(self)
                 
@@ -55,8 +56,7 @@
             i.move([0,pos])
             
     def autoScroll(self, speed):
-        if speed > pguiListMaximumSpeed:
-            speed = pguiListMaximumSpeed
+
         
         if speed <= 0:
             self.speedAux = 0

Modified: trunk/pgui/locale.py
===================================================================
--- trunk/pgui/locale.py	2008-03-09 13:13:52 UTC (rev 47)
+++ trunk/pgui/locale.py	2008-03-09 13:38:18 UTC (rev 48)
@@ -15,7 +15,7 @@
 pguiWhilePressedSlot = 2
 
 #List Widget
-pguiListMaximumSpeed = 40
+pguiListMaximumSpeed = 20
 
 
 

Modified: trunk/pychord2/main_window.py
===================================================================
--- trunk/pychord2/main_window.py	2008-03-09 13:13:52 UTC (rev 47)
+++ trunk/pychord2/main_window.py	2008-03-09 13:38:18 UTC (rev 48)
@@ -61,11 +61,11 @@
         btFF.registerPressedSlot(lst.increaseSpeed)
         self.addElement(btFF)
         
-        btST = Ibutton(self,[730,350],"stop.png")
+        btST = Ibutton(self,[720,340],"stop.png")
         btST.registerClickSlot(lst.autoScroll,0)
         self.addElement(btST)
         
-        btRR = Ibutton(self,[730,300],"rr.png")
+        btRR = Ibutton(self,[730,280],"rr.png")
         btRR.registerPressedSlot(lst.decreaseSpeed)
         self.addElement(btRR)
    
\ No newline at end of file



More information about the Pychord-commits mailing list