UI: Fix reordering scenes not working properly

If the user were reordering scenes, the preview scene would change
to a different one, than the one they were currently on.
This commit is contained in:
Clayton Groeneveld 2021-04-10 07:43:04 -05:00 committed by Jim
parent bb0dff60ab
commit bab21888f3

View file

@ -4952,12 +4952,12 @@ void OBSBasic::ChangeSceneIndex(bool relative, int offset, int invalidIdx)
if (idx == -1 || idx == invalidIdx)
return;
ui->scenes->blockSignals(true);
QListWidgetItem *item = ui->scenes->takeItem(idx);
if (!relative)
idx = 0;
ui->scenes->blockSignals(true);
ui->scenes->insertItem(idx + offset, item);
ui->scenes->setCurrentRow(idx + offset);
item->setSelected(true);