UI: Remove listbox selection if deselected
If the item currently selected in the source listbox is deselected in the preview, then make sure to deselect it in the listbox as well.
This commit is contained in:
parent
853e63765e
commit
1cfe72664a
1 changed files with 7 additions and 2 deletions
|
|
@ -925,7 +925,7 @@ void OBSBasic::RenameSources(QString newName, QString prevName)
|
|||
|
||||
void OBSBasic::SelectSceneItem(OBSScene scene, OBSSceneItem item, bool select)
|
||||
{
|
||||
if (!select || scene != GetCurrentScene())
|
||||
if (scene != GetCurrentScene())
|
||||
return;
|
||||
|
||||
for (int i = 0; i < ui->sources->count(); i++) {
|
||||
|
|
@ -937,7 +937,12 @@ void OBSBasic::SelectSceneItem(OBSScene scene, OBSSceneItem item, bool select)
|
|||
if (item != data.value<OBSSceneItem>())
|
||||
continue;
|
||||
|
||||
ui->sources->setCurrentItem(witem);
|
||||
if (select) {
|
||||
ui->sources->setCurrentItem(witem);
|
||||
} else if (ui->sources->currentItem() == witem) {
|
||||
ui->sources->setCurrentItem(nullptr);
|
||||
}
|
||||
|
||||
break;
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue