Files
oak-editor/app/panel/curve/curve.cpp
T
itsmattkc 17c1493aa7 all time-based panels are now derived from a common base class
Cuts down on a lot of duplicate code between
TimelineWidget/ViewerWidget/CurveWidget/NodeParamView
and TimelinePanel/ViewerPanel/CurvePanel/ParamPanel since they all use similar
time functions.
2020-02-01 19:39:43 +11:00

39 lines
851 B
C++

#include "curve.h"
CurvePanel::CurvePanel(QWidget *parent) :
TimeBasedPanel(parent)
{
// FIXME: This won't work if there's ever more than one of this panel
setObjectName("CurvePanel");
// Create main widget and set it
SetTimeBasedWidget(new CurveWidget());
// Set strings
Retranslate();
}
void CurvePanel::SetInput(NodeInput *input)
{
static_cast<CurveWidget*>(GetTimeBasedWidget())->SetInput(input);
}
void CurvePanel::IncreaseTrackHeight()
{
CurveWidget* c = static_cast<CurveWidget*>(GetTimeBasedWidget());
c->SetVerticalScale(c->GetVerticalScale() * 2);
}
void CurvePanel::DecreaseTrackHeight()
{
CurveWidget* c = static_cast<CurveWidget*>(GetTimeBasedWidget());
c->SetVerticalScale(c->GetVerticalScale() * 0.5);
}
void CurvePanel::Retranslate()
{
TimeBasedPanel::Retranslate();
SetTitle(tr("Curve Editor"));
}