feat(parameter): add clamp

This commit is contained in:
parker
2025-07-18 04:41:47 +01:00
parent c3ea851e49
commit 9a05c1a8bb
3 changed files with 59 additions and 11 deletions

View File

@@ -1,5 +1,8 @@
#pragma once
#include "Engine/Types.h"
#include <QWidget>
#include <QVBoxLayout>
#include <QLabel>
namespace enzo::ui
{
@@ -11,14 +14,21 @@ public:
AbstractSliderParm(QWidget *parent = nullptr, Qt::WindowFlags f = Qt::WindowFlags());
private:
float value_;
void setValue(bt::floatT value);
QVBoxLayout* mainLayout_;
QLabel* valueLabel_;
bt::floatT value_;
float defaultValue_=0;
float minValue_;
float maxValue_=10;
bool clampMin_ = true;
bool clampMax_ = true;
bt::floatT minValue_=-5;
bt::floatT maxValue_=10;
protected:
void paintEvent(QPaintEvent *event) override;
void mouseMoveEvent(QMouseEvent *event) override;
void mousePressEvent(QMouseEvent *event) override;
};