feat(parameter): persistant parameter value

This commit is contained in:
parker
2025-07-23 20:31:02 +01:00
parent ae78e15931
commit 884c7a094a
6 changed files with 60 additions and 24 deletions

View File

@@ -13,6 +13,8 @@
enzo::ui::AbstractSliderParm::AbstractSliderParm(QWidget *parent, Qt::WindowFlags f)
: QWidget(parent, f)
{
// tells qt to style the widget even though it's a Q_OBJECT
setAttribute(Qt::WA_StyledBackground, true);
setFixedHeight(24);
value_ = defaultValue_;
@@ -53,8 +55,8 @@ void enzo::ui::AbstractSliderParm::paintEvent(QPaintEvent *event)
void enzo::ui::AbstractSliderParm::setValue(bt::floatT value)
{
if(value_==value)
return;
// if(value_==value)
// return;
if(clampMin_ && value<minValue_) { value = minValue_; }
if(clampMax_ && value>maxValue_) { value = maxValue_; }
@@ -65,6 +67,8 @@ void enzo::ui::AbstractSliderParm::setValue(bt::floatT value)
valStr.truncate(4);
valueLabel_->setText(valStr);
valueChanged(value_);
}