scroll only in increments when dragging the playhead

This commit is contained in:
itsmattkc
2021-01-24 18:38:57 +11:00
parent 0f38769208
commit 2c7e974f78
6 changed files with 98 additions and 31 deletions
+5 -1
View File
@@ -34,7 +34,8 @@ SeekableWidget::SeekableWidget(QWidget* parent) :
time_(0),
timeline_points_(nullptr),
scroll_(0),
snap_service_(nullptr)
snap_service_(nullptr),
dragging_(false)
{
QFontMetrics fm = fontMetrics();
@@ -86,6 +87,7 @@ void SeekableWidget::mousePressEvent(QMouseEvent *event)
{
if (event->button() == Qt::LeftButton) {
SeekToScreenPoint(event->pos().x());
dragging_ = true;
}
}
@@ -103,6 +105,8 @@ void SeekableWidget::mouseReleaseEvent(QMouseEvent *event)
if (snap_service_) {
snap_service_->HideSnaps();
}
dragging_ = false;
}
void SeekableWidget::ScaleChangedEvent(const double &)
+7
View File
@@ -42,6 +42,11 @@ public:
void SetSnapService(SnapService* service);
bool IsDraggingPlayhead() const
{
return dragging_;
}
public slots:
void SetTime(const int64_t &r);
@@ -98,6 +103,8 @@ private:
SnapService* snap_service_;
bool dragging_;
};
}