From 1cfe72664a72af104c3cd579e59e690e2970a774 Mon Sep 17 00:00:00 2001 From: jp9000 Date: Sat, 4 Apr 2015 04:20:54 -0700 Subject: [PATCH] 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. --- obs/window-basic-main.cpp | 9 +++++++-- 1 file changed, 7 insertions(+), 2 deletions(-) diff --git a/obs/window-basic-main.cpp b/obs/window-basic-main.cpp index 998051f10..8d21769d7 100644 --- a/obs/window-basic-main.cpp +++ b/obs/window-basic-main.cpp @@ -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()) continue; - ui->sources->setCurrentItem(witem); + if (select) { + ui->sources->setCurrentItem(witem); + } else if (ui->sources->currentItem() == witem) { + ui->sources->setCurrentItem(nullptr); + } + break; } }