timebasedwidget: rewrote scroll catchup code

Code is much better. Less hacky queuing, implements cooldowns to improve navigation, and introduces a framework so that subclasses can make use of catchup/cooldown code too with any scrollbar they want
This commit is contained in:
itsmattkc
2022-07-15 10:59:51 -07:00
parent 4b8febd10d
commit e4fd2d5d2c
11 changed files with 103 additions and 20 deletions
+7 -1
View File
@@ -132,6 +132,7 @@ NodeParamView::NodeParamView(bool create_keyframe_view, QWidget *parent) :
connect(keyframe_view_, &KeyframeView::TimeChanged, ruler(), &TimeRuler::SetTime);
connect(keyframe_view_, &KeyframeView::TimeChanged, this, &NodeParamView::SetTime);
connect(keyframe_view_, &KeyframeView::Dragged, this, &NodeParamView::KeyframeViewDragged);
connect(keyframe_view_, &KeyframeView::Released, this, &NodeParamView::KeyframeViewReleased);
// Connect keyframe view scaling to this
connect(keyframe_view_, &KeyframeView::ScaleChanged, this, &NodeParamView::SetScale);
@@ -929,7 +930,12 @@ void NodeParamView::KeyframeViewDragged(int x, int y)
{
Q_UNUSED(y)
QMetaObject::invokeMethod(this, "CatchUpScrollToPoint", Qt::QueuedConnection, Q_ARG(int, x));
SetCatchUpScrollValue(x);
}
void NodeParamView::KeyframeViewReleased()
{
StopCatchUpScrollTimer();
}
void NodeParamView::UpdateElementY()