diff options
author | Jaime van Kessel <nallath@gmail.com> | 2019-12-24 14:53:19 +0300 |
---|---|---|
committer | Jaime van Kessel <nallath@gmail.com> | 2019-12-24 14:53:19 +0300 |
commit | 41c953112ae6ef87eac3ca461b4b1a023435368d (patch) | |
tree | c4e292267e86cc851481968592c02008bb99bb9f /cura/UI | |
parent | d110d04c368a867487e8e690fa1dae74586091b9 (diff) |
Make animation time instead of update dependant
CURA-6823
Diffstat (limited to 'cura/UI')
-rw-r--r-- | cura/UI/CuraSplashScreen.py | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/cura/UI/CuraSplashScreen.py b/cura/UI/CuraSplashScreen.py index 70df454e7d..4074020865 100644 --- a/cura/UI/CuraSplashScreen.py +++ b/cura/UI/CuraSplashScreen.py @@ -9,6 +9,7 @@ from UM.Resources import Resources from UM.Application import Application from cura import ApplicationMetadata +import time class CuraSplashScreen(QSplashScreen): def __init__(self): @@ -34,15 +35,20 @@ class CuraSplashScreen(QSplashScreen): self._change_timer.setSingleShot(False) self._change_timer.timeout.connect(self.updateLoadingImage) + self._last_update_time = None + def show(self): super().show() + self._last_update_time = time.time() self._change_timer.start() def updateLoadingImage(self): if self._to_stop: return - - self._loading_image_rotation_angle -= 10 + time_since_last_update = time.time() - self._last_update_time + self._last_update_time = time.time() + # Since we don't know how much time actually passed, check how many intervals of 50 we had. + self._loading_image_rotation_angle -= 10 * (time_since_last_update * 1000 / 50) self.repaint() # Override the mousePressEvent so the splashscreen doesn't disappear when clicked |