[prev in list] [next in list] [prev in thread] [next in thread] 

List:       kde-commits
Subject:    KDE/kdegames
From:       Wolfgang Rohdewald <wolfgang () rohdewald ! de>
Date:       2010-11-01 17:20:26
Message-ID: 20101101172026.036B1AC89C () svn ! kde ! org
[Download RAW message or body]

SVN commit 1192009 by wrohdewald:

Config, slider for animation speed: revert meaning: leftmost
value 0 is slowest, rightmost value 99 is 'no animation'

 M  +1 -1      doc/kajongg/index.docbook  
 M  +9 -3      kajongg/src/animation.py  
 M  +1 -1      kajongg/src/board.py  


--- trunk/KDE/kdegames/doc/kajongg/index.docbook #1192008:1192009
@@ -593,7 +593,7 @@
 					<guilabel>Animation speed</guilabel>
 				</term>
 				<listitem><para>
-		Define how fast the tiles should move around. If you move the slider to the leftmost position, tile \
movement is not animated: +		Define how fast the tiles should move around. If you move the slider to the \
rightmost position, tile movement is not animated:  the tiles will simply change place.
 </para></listitem>
 			</varlistentry>
--- trunk/KDE/kdegames/kajongg/src/animation.py #1192008:1192009
@@ -30,7 +30,7 @@
     def __init__(self, target, propName, endValue, parent=None):
         QPropertyAnimation.__init__(self, target, propName, parent)
         self.setEndValue(endValue)
-        duration = PREF.animationSpeed * 100 / 4
+        duration = (99 - PREF.animationSpeed) * 100 / 4
         self.setDuration(duration)
         self.setEasingCurve(QEasingCurve.InOutQuad)
 
@@ -72,6 +72,9 @@
     def __init__(self, animations, deferred, parent=None):
         QSequentialAnimationGroup.__init__(self, parent)
         self.deferred = deferred
+        if not animations:
+            self.callDeferred()
+            return
         for group in animations:
             self.addAnimation(group)
             for animation in group.children():
@@ -89,6 +92,10 @@
             debugMessage('CANNOT ANIMATE THIS!')
             self.fixAnimations()
             self.fixAllBoards()
+            self.callDeferred()
+
+    def callDeferred(self):
+        """if we have a deferred, callback now and make sure we dont call again"""
             if self.deferred:
                 deferred = self.deferred
                 self.deferred = None
@@ -122,8 +129,7 @@
         """all animations have finished. Cleanup and callback"""
         self.fixAnimations()
         self.fixAllBoards()
-        if self.deferred:
-            self.deferred.callback('done')
+        self.callDeferred()
 
     def fixAllBoards(self):
         """set correct drawing order for all changed boards"""
--- trunk/KDE/kdegames/kajongg/src/board.py #1192008:1192009
@@ -529,7 +529,7 @@
     def placeTile(self, tile, atOnce=False):
         """places the tile in the scene"""
         newPos, newRotation, newScale = self.tilePlace(tile)
-        if not atOnce and not InternalParameters.field.centralView.dragObject and PREF.animationSpeed \
and tile.pos(): +        if not atOnce and not InternalParameters.field.centralView.dragObject and \
                PREF.animationSpeed != 99 and tile.pos():
             # we must animate all properties even if current value and wanted value are the same.
             # if we mix tiles and rebuild the wall, a tile might have the same property as before -
             # but it must have been moved meanwhile while mixing.


[prev in list] [next in list] [prev in thread] [next in thread] 

Configure | About | News | Add a list | Sponsored by KoreLogic