timeline: show tooltip

I don't know when this was removed but now it's back. Tooltips have a chance of getting in the way so this may switch to the status bar at some point.
This commit is contained in:
itsmattkc
2021-07-18 11:06:38 -07:00
parent 24b9756e3b
commit 97c14dba70
@@ -88,6 +88,19 @@ void TimelineView::mouseMoveEvent(QMouseEvent *event)
return;
}
if (event->buttons() == Qt::NoButton) {
Block* b = GetItemAtScenePos(timeline_event.GetFrame(), timeline_event.GetTrack().index());
if (b) {
setToolTip(tr("In: %1\nOut: %2\nDuration: %3").arg(
Timecode::time_to_timecode(b->in(), timebase(), Core::instance()->GetTimecodeDisplay()),
Timecode::time_to_timecode(b->out(), timebase(), Core::instance()->GetTimecodeDisplay()),
Timecode::time_to_timecode(b->length(), timebase(), Core::instance()->GetTimecodeDisplay())
));
} else {
setToolTip(QString());
}
}
emit MouseMoved(&timeline_event);
}