retraction: fix issue with infinite scale

This commit is contained in:
Alfredo Monclus 2024-06-03 17:54:11 -03:00
parent 792fcb80c5
commit ad0562fc60

View File

@ -76,9 +76,6 @@ class Panel(ScreenPanel):
return return
self.values[option] = float(value) self.values[option] = float(value)
self.list[option]['scale'].disconnect_by_func(self.set_opt_value)
self.list[option]['scale'].set_value(self.values[option])
self.list[option]['scale'].connect("button-release-event", self.set_opt_value, option)
# Infinite scale # Infinite scale
for opt in self.options: for opt in self.options:
if opt['option'] == option: if opt['option'] == option:
@ -87,6 +84,9 @@ class Panel(ScreenPanel):
else: else:
self.list[option]['adjustment'].set_upper(opt["maxval"]) self.list[option]['adjustment'].set_upper(opt["maxval"])
break break
self.list[option]['scale'].set_value(self.values[option])
self.list[option]['scale'].disconnect_by_func(self.set_opt_value)
self.list[option]['scale'].connect("button-release-event", self.set_opt_value, option)
def add_option(self, option, optname, units, value, digits, maxval): def add_option(self, option, optname, units, value, digits, maxval):
logging.info(f"Adding option: {option}") logging.info(f"Adding option: {option}")