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:
@@ -150,6 +150,14 @@ protected:
|
||||
|
||||
void PassWheelEventsToScrollBar(QObject* object);
|
||||
|
||||
void SetCatchUpScrollValue(QScrollBar *b, int v, int maximum);
|
||||
void SetCatchUpScrollValue(int v);
|
||||
void StopCatchUpScrollTimer(QScrollBar *b);
|
||||
void StopCatchUpScrollTimer()
|
||||
{
|
||||
StopCatchUpScrollTimer(scrollbar_);
|
||||
}
|
||||
|
||||
virtual const QVector<Block*> *GetSnapBlocks() const { return nullptr; }
|
||||
virtual const QVector<KeyframeViewInputConnection*> *GetSnapKeyframes() const { return nullptr; }
|
||||
virtual const std::vector<NodeKeyframe*> *GetSnapIgnoreKeyframes() const { return nullptr; }
|
||||
@@ -228,6 +236,14 @@ private:
|
||||
TimelineWorkArea *workarea_;
|
||||
TimelineMarkerList *markers_;
|
||||
|
||||
QTimer *catchup_scroll_timer_;
|
||||
struct CatchUpScrollData {
|
||||
qint64 last_forced = 0;
|
||||
int maximum;
|
||||
int value;
|
||||
};
|
||||
QMap<QScrollBar*, CatchUpScrollData> catchup_scroll_values_;
|
||||
|
||||
private slots:
|
||||
void UpdateMaximumScroll();
|
||||
|
||||
@@ -247,6 +263,8 @@ private slots:
|
||||
|
||||
void CatchUpScrollToPoint(int point);
|
||||
|
||||
void CatchUpTimerTimeout();
|
||||
|
||||
void AutoUpdateTimebase();
|
||||
|
||||
void ConnectedNodeRemovedFromGraph();
|
||||
|
||||
Reference in New Issue
Block a user