Skip to content

Commit f057a3c

Browse files
committed
Version R2.21-FP-9a
1 parent 00b1cd2 commit f057a3c

File tree

3 files changed

+19
-24
lines changed

3 files changed

+19
-24
lines changed

bin/Code/MainWindow/WAnalysisBar.py

Lines changed: 17 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -18,6 +18,7 @@ def __init__(self, w_parent, board):
1818
self.timer = None
1919
self.activated = False
2020
self.value_objective = 0
21+
self.acercando = False
2122
self.aeval = AnalysisEval.AnalysisEval()
2223
self.interval = Code.configuration.x_analyzer_mstime_refresh_ab
2324

@@ -27,8 +28,6 @@ def __init__(self, w_parent, board):
2728
self.progressbar.setValue(5000)
2829
self.progressbar.setTextVisible(False)
2930

30-
self.animation = QtCore.QPropertyAnimation(self.progressbar, b"value")
31-
3231
self.lb_value_up = Controles.LB(self).set_font_type(puntos=7).align_center()
3332
self.lb_value_down = Controles.LB(self).set_font_type(puntos=7).align_center()
3433

@@ -178,29 +177,25 @@ def mousePressEvent(self, event):
178177
def update_value(self, value):
179178
if not self.activated:
180179
return
181-
self.value_objective = max(0, min(value, 10000))
182-
self.goto_objective()
180+
if value > 10000:
181+
value = 10000
182+
elif value < 0:
183+
value = 0
184+
self.value_objective = value
185+
if not self.acercando:
186+
self.goto_objective()
183187

184188
def goto_objective(self):
185189
if not self.engine_manager or not self.activated:
186-
self.animation.stop()
190+
self.acercando = False
187191
return
188192
value = self.progressbar.value()
189193
if value != self.value_objective:
190-
delta = abs(self.value_objective - value)
191-
192-
# entre 300ms (pequeños) y 2000ms (grandes)
193-
duration = min(max(300 + delta * 0.1, 300), 2000)
194-
if delta < 500:
195-
curve = QtCore.QEasingCurve.Type.OutQuad
196-
elif delta < 2500:
197-
curve = QtCore.QEasingCurve.Type.OutCubic
198-
else:
199-
curve = QtCore.QEasingCurve.Type.OutQuint
200-
201-
self.animation.stop()
202-
self.animation.setStartValue(value)
203-
self.animation.setEndValue(self.value_objective)
204-
self.animation.setDuration(int(duration))
205-
self.animation.setEasingCurve(curve)
206-
self.animation.start()
194+
velocidad = max(abs(self.value_objective - value) // 50, 1)
195+
self.acercando = True
196+
add = +1 if self.value_objective > value else -1
197+
self.progressbar.setValue(value + add * velocidad)
198+
self.update()
199+
QtCore.QTimer.singleShot(2, self.goto_objective)
200+
else:
201+
self.acercando = False

bin/Code/__init__.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -142,7 +142,7 @@ def relative_root(path):
142142

143143

144144
BASE_VERSION = "B" # Para el control de updates que necesitan reinstalar entero
145-
VERSION = "R 2.21-FP-9"
145+
VERSION = "R 2.21-FP-9a"
146146
DEBUG = False
147147
DEBUG_ENGINES = False
148148

bin/bug.log

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
Version R 2.21-FP-9
1+
Version R 2.21-FP-9a

0 commit comments

Comments
 (0)