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
@@ -45,6 +45,7 @@ TimelineView::TimelineView(const TrackType &type, Qt::Alignment vertical_alignme
setBackgroundRole(QPalette::Window);
setContextMenuPolicy(Qt::CustomContextMenu);
SetLimitYAxis(true);
viewport()->setMouseTracking(true);
}
void TimelineView::SelectAll()
@@ -207,6 +208,25 @@ void TimelineView::drawBackground(QPainter *painter, const QRectF &rect)
}
}
void TimelineView::ToolChangedEvent(Tool::Item tool)
{
switch (tool) {
case Tool::kRazor:
setCursor(Qt::SplitHCursor);
break;
case Tool::kEdit:
setCursor(Qt::IBeamCursor);
break;
case Tool::kAdd:
case Tool::kTransition:
case Tool::kZoom:
setCursor(Qt::CrossCursor);
break;
default:
unsetCursor();
}
}
Stream::Type TimelineView::TrackTypeToStreamType(TrackType track_type)
{
switch (track_type) {