mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-12 20:29:05 +08:00
Improve exposed progress prop
Contributes to CL-1153
This commit is contained in:
parent
95400282b9
commit
0363c1257c
@ -133,9 +133,8 @@ class PrintJobOutputModel(QObject):
|
|||||||
@pyqtProperty(float, notify = timeElapsedChanged)
|
@pyqtProperty(float, notify = timeElapsedChanged)
|
||||||
def progress(self) -> float:
|
def progress(self) -> float:
|
||||||
result = self.timeElapsed / self.timeTotal
|
result = self.timeElapsed / self.timeTotal
|
||||||
if result > 1.0:
|
# Never get a progress past 1.0
|
||||||
result = 1.0
|
return min(result, 1.0)
|
||||||
return result
|
|
||||||
|
|
||||||
@pyqtProperty(str, notify=stateChanged)
|
@pyqtProperty(str, notify=stateChanged)
|
||||||
def state(self) -> str:
|
def state(self) -> str:
|
||||||
|
Loading…
x
Reference in New Issue
Block a user