chore: cleanup repeating code
This commit is contained in:
@@ -108,13 +108,7 @@ class NumberLineEdit(QLineEdit):
|
||||
@Slot(float)
|
||||
def update_value(self, val: float):
|
||||
if abs(val - self.saved_value) > 0.001:
|
||||
self.blockSignals(True)
|
||||
self.saved_value = val
|
||||
self.setText(self.to_string(val))
|
||||
self.blockSignals(False)
|
||||
# programmatic rewrite is a commit: the shown value IS the applied one
|
||||
self._applied_value = val
|
||||
self._set_pending(False)
|
||||
self.force_update_value(val)
|
||||
|
||||
def force_update_value(self, val: float):
|
||||
# Always update text and saved_value
|
||||
|
||||
Reference in New Issue
Block a user