implemented cursors in the timeline

Note: this does not use the cursor SVGs in app/ui/cursors since I was never
really satisfied with them. They're kept for posterity for the time being.
This commit is contained in:
itsmattkc
2020-01-03 17:58:07 +11:00
parent 7f796bd99f
commit ef91f81e0f
22 changed files with 129 additions and 30 deletions
@@ -14,6 +14,7 @@ TimelineViewBase::TimelineViewBase(QWidget *parent) :
playhead_(0),
playhead_scene_left_(-1),
playhead_scene_right_(-1),
dragging_playhead_(false),
dragging_hand_(false),
limit_y_axis_(false)
{
@@ -136,7 +137,13 @@ bool TimelineViewBase::PlayheadMove(QMouseEvent *event)
bool TimelineViewBase::PlayheadRelease(QMouseEvent *event)
{
return dragging_playhead_;
if (dragging_playhead_) {
dragging_playhead_ = false;
return true;
}
return false;
}
bool TimelineViewBase::HandPress(QMouseEvent *event)
@@ -199,6 +206,10 @@ bool TimelineViewBase::HandRelease(QMouseEvent *event)
return false;
}
void TimelineViewBase::ToolChangedEvent(Tool::Item tool)
{
}
qreal TimelineViewBase::GetPlayheadX()
{
return TimeToScene(rational(playhead_ * timebase().numerator(), timebase().denominator()));
@@ -324,4 +335,6 @@ void TimelineViewBase::ApplicationToolChanged(Tool::Item tool)
} else {
setDragMode(default_drag_mode_);
}
ToolChangedEvent(tool);
}