UI: Clear context bar on scene collection change

Fixes a bug where the source toolbar would show the previously selected
source from the prior scene collection when changing to a new scene
collection
master
jp9000 2020-08-25 00:39:06 -07:00
parent d310f1532b
commit 68dcee824e
2 changed files with 10 additions and 3 deletions

View File

@ -906,6 +906,7 @@ void OBSBasic::Load(const char *file)
ClearSceneData();
InitDefaultTransitions();
ClearContextBar();
obs_data_t *modulesObj = obs_data_get_obj(data, "modules");
if (api)
@ -2885,15 +2886,20 @@ void OBSBasic::RenameSources(OBSSource source, QString newName,
UpdateContextBar();
}
void OBSBasic::UpdateContextBar()
void OBSBasic::ClearContextBar()
{
OBSSceneItem item = GetCurrentSceneItem();
QLayoutItem *la = ui->emptySpace->layout()->itemAt(0);
if (la) {
delete la->widget();
ui->emptySpace->layout()->removeItem(la);
}
}
void OBSBasic::UpdateContextBar()
{
OBSSceneItem item = GetCurrentSceneItem();
ClearContextBar();
if (item) {
obs_source_t *source = obs_sceneitem_get_source(item);

View File

@ -1009,6 +1009,7 @@ public slots:
bool RecordingActive();
bool ReplayBufferActive();
void ClearContextBar();
void UpdateContextBar();
public: