timeline: improved subtitle import behavior

This commit is contained in:
itsmattkc
2022-05-16 08:37:14 -07:00
parent d4987c3a78
commit 7130371690
7 changed files with 8 additions and 47 deletions
+5 -1
View File
@@ -97,6 +97,11 @@ void ImportTool::DragEnter(TimelineViewMouseEvent *event)
PrepGhosts(ghost_offset_, drag_start_.GetTrack().index());
if (parent()->HasGhosts() || !parent()->GetConnectedNode()) {
// We only clear the tentative track if the mimedata is about to be destroyed (i.e. the drag
// is cancelled). If we do this in DragLeave, it leads to undesirable behavior if the cursor
// is going between views (subtitle track rapidly appearing and disappearing)
QObject::connect(event->GetMimeData(), &QObject::destroyed, parent(), &TimelineWidget::ClearTentativeSubtitleTrack);
event->accept();
} else {
event->ignore();
@@ -167,7 +172,6 @@ void ImportTool::DragLeave(QDragLeaveEvent* event)
{
if (!dragged_footage_.isEmpty()) {
parent()->ClearGhosts();
parent()->ClearTentativeSubtitleTrack();
dragged_footage_.clear();
event->accept();