keyframeviewbase: cleaned up code and show tooltip values in input's desired format

This commit is contained in:
itsmattkc
2021-01-25 11:05:09 +11:00
parent 9f99182089
commit 4e5db91c17
11 changed files with 135 additions and 162 deletions
+3 -1
View File
@@ -20,6 +20,8 @@
#include "pan.h"
#include "widget/slider/floatslider.h"
namespace olive {
PanNode::PanNode()
@@ -29,7 +31,7 @@ PanNode::PanNode()
panning_input_ = new NodeInput(this, QStringLiteral("panning_in"), NodeValue::kFloat, 0.0);
panning_input_->setProperty("min", -1.0);
panning_input_->setProperty("max", 1.0);
panning_input_->setProperty("view", QStringLiteral("percent"));
panning_input_->setProperty("view", FloatSlider::kPercentage);
}
Node *PanNode::copy() const
+3 -1
View File
@@ -20,6 +20,8 @@
#include "volume.h"
#include "widget/slider/floatslider.h"
namespace olive {
VolumeNode::VolumeNode()
@@ -29,7 +31,7 @@ VolumeNode::VolumeNode()
volume_input_ = new NodeInput(this, QStringLiteral("volume_in"), NodeValue::kFloat, 1.0);
volume_input_->setProperty("min", 0.0);
volume_input_->setProperty("view", QStringLiteral("db"));
volume_input_->setProperty("view", FloatSlider::kDecibel);
}
Node *VolumeNode::copy() const
+2 -1
View File
@@ -24,6 +24,7 @@
#include "node/output/track/track.h"
#include "transition/transition.h"
#include "widget/slider/floatslider.h"
namespace olive {
@@ -52,7 +53,7 @@ Block::Block() :
speed_input_ = new NodeInput(this, QStringLiteral("speed_in"), NodeValue::kFloat);
speed_input_->SetStandardValue(1.0);
speed_input_->setProperty("view", QStringLiteral("percent"));
speed_input_->setProperty("view", FloatSlider::kPercentage);
// A block's length must be greater than 0
set_length_and_media_out(1);
+5 -4
View File
@@ -21,6 +21,7 @@
#include "cropdistortnode.h"
#include "common/lerp.h"
#include "widget/slider/floatslider.h"
namespace olive {
@@ -31,22 +32,22 @@ CropDistortNode::CropDistortNode()
left_input_ = new NodeInput(this, QStringLiteral("left_in"), NodeValue::kFloat, 0.0);
left_input_->setProperty("min", 0.0);
left_input_->setProperty("max", 1.0);
left_input_->setProperty("view", QStringLiteral("percent"));
left_input_->setProperty("view", FloatSlider::kPercentage);
top_input_ = new NodeInput(this, QStringLiteral("top_in"), NodeValue::kFloat, 0.0);
top_input_->setProperty("min", 0.0);
top_input_->setProperty("max", 1.0);
top_input_->setProperty("view", QStringLiteral("percent"));
top_input_->setProperty("view", FloatSlider::kPercentage);
right_input_ = new NodeInput(this, QStringLiteral("right_in"), NodeValue::kFloat, 0.0);
right_input_->setProperty("min", 0.0);
right_input_->setProperty("max", 1.0);
right_input_->setProperty("view", QStringLiteral("percent"));
right_input_->setProperty("view", FloatSlider::kPercentage);
bottom_input_ = new NodeInput(this, QStringLiteral("bottom_in"), NodeValue::kFloat, 0.0);
bottom_input_->setProperty("min", 0.0);
bottom_input_->setProperty("max", 1.0);
bottom_input_->setProperty("view", QStringLiteral("percent"));
bottom_input_->setProperty("view", FloatSlider::kPercentage);
feather_input_ = new NodeInput(this, QStringLiteral("feather_in"), NodeValue::kFloat, 0.0);
feather_input_->setProperty("min", 0.0);
+2 -1
View File
@@ -21,6 +21,7 @@
#include "stroke.h"
#include "render/color.h"
#include "widget/slider/floatslider.h"
namespace olive {
@@ -37,7 +38,7 @@ StrokeFilterNode::StrokeFilterNode()
radius_input_->setProperty("min", 0.0f);
opacity_input_ = new NodeInput(this, QStringLiteral("opacity_in"), NodeValue::kFloat, 1.0f);
opacity_input_->setProperty("view", QStringLiteral("percent"));
opacity_input_->setProperty("view", FloatSlider::kPercentage);
opacity_input_->setProperty("min", 0.0f);
opacity_input_->setProperty("max", 1.0f);
+3 -1
View File
@@ -23,6 +23,8 @@
#include <QMatrix4x4>
#include <QVector2D>
#include "widget/slider/floatslider.h"
namespace olive {
MatrixGenerator::MatrixGenerator()
@@ -33,7 +35,7 @@ MatrixGenerator::MatrixGenerator()
scale_input_ = new NodeInput(this, QStringLiteral("scale_in"), NodeValue::kVec2, QVector2D(1.0f, 1.0f));
scale_input_->setProperty("min", QVector2D(0, 0));
scale_input_->setProperty("view", QStringLiteral("percent"));
scale_input_->setProperty("view", FloatSlider::kPercentage);
scale_input_->setProperty("disabley", true);
uniform_scale_input_ = new NodeInput(this, QStringLiteral("uniform_scale_in"), NodeValue::kBoolean, true);