]> git.sesse.net Git - nageru/commitdiff
When adding a new clip, scroll to the bottom.
authorSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 10 Dec 2018 21:58:16 +0000 (22:58 +0100)
committerSteinar H. Gunderson <sgunderson@bigfoot.com>
Mon, 10 Dec 2018 21:58:16 +0000 (22:58 +0100)
futatabi/mainwindow.cpp

index 81ef10b3a4bb1e8ab1a4cd3e72502e3cfce65558..1412e251fcf3b75ea771d65e7a59625a81ba1a3d 100644 (file)
@@ -159,6 +159,7 @@ void MainWindow::cue_in_clicked()
        clip.pts_in = current_pts;
        cliplist_clips->add_clip(clip);
        playlist_selection_changed();
+       ui->clip_list->scrollToBottom();
 }
 
 void MainWindow::cue_out_clicked()
@@ -182,6 +183,7 @@ void MainWindow::queue_clicked()
                if (clip.pts_out != -1) {
                        playlist_clips->add_clip(clip);
                        playlist_selection_changed();
+                       ui->playlist->scrollToBottom();
                }
                return;
        }
@@ -198,6 +200,12 @@ void MainWindow::queue_clicked()
        if (clip.pts_out != -1) {
                playlist_clips->add_clip(clip);
                playlist_selection_changed();
+               ui->playlist->scrollToBottom();
+               if (!ui->playlist->selectionModel()->hasSelection()) {
+                       // TODO: Figure out why this doesn't always seem to actually select the row.
+                       QModelIndex bottom = playlist_clips->index(playlist_clips->size() - 1, 0);
+                       ui->playlist->setCurrentIndex(bottom);
+               }
        }
 }