From b988c3c8c97a5377f09e110fdfb7679e9048dc92 Mon Sep 17 00:00:00 2001 From: alfrix Date: Thu, 27 Oct 2022 12:15:18 -0300 Subject: [PATCH] limits: fix sliders rescaling and not restoring values when set lower than the max configured value --- panels/limits.py | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/panels/limits.py b/panels/limits.py index 859dcae0..d914c775 100644 --- a/panels/limits.py +++ b/panels/limits.py @@ -67,10 +67,11 @@ class LimitsPanel(ScreenPanel): if opt["option"] == option: if self.values[option] > opt["max"]: self.limits[option]['scale'].get_style_context().add_class("option_slider_max") + # Infinite scale + self.limits[option]['adjustment'].set_upper(self.values[option] * 1.5) else: self.limits[option]['scale'].get_style_context().remove_class("option_slider_max") - # Infinite scale - self.limits[option]['adjustment'].set_upper(self.values[option] * 1.5) + self.limits[option]['adjustment'].set_upper(opt["max"] * 1.5) self.limits[option]['scale'].connect("button-release-event", self.set_opt_value, option) def add_option(self, option, optname, units, value):