mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-11-02 20:52:20 -07:00
Make animation time instead of update dependant
CURA-6823
This commit is contained in:
parent
d110d04c36
commit
41c953112a
1 changed files with 8 additions and 2 deletions
|
|
@ -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
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue