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