feat(parameter): persistant parameter value
This commit is contained in:
@@ -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_);
|
||||
|
||||
}
|
||||
|
||||
|
||||
|
||||
Reference in New Issue
Block a user