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:
@@ -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) {
|
||||
|
||||
Reference in New Issue
Block a user