mirror of
https://github.com/obsproject/obs-studio.git
synced 2024-07-19 17:49:14 +00:00
UI: Don't show properties on creation if no properties
If a source doesn't have any properties, don't show properties on creation
This commit is contained in:
parent
b4bb574397
commit
0be3524658
|
@ -5599,12 +5599,23 @@ void OBSBasic::on_scenes_itemDoubleClicked(QListWidgetItem *witem)
|
|||
}
|
||||
}
|
||||
|
||||
static inline bool should_show_properties(obs_source_t *source, const char *id)
|
||||
{
|
||||
if (!source)
|
||||
return false;
|
||||
if (strcmp(id, "group") == 0)
|
||||
return false;
|
||||
if (!obs_source_configurable(source))
|
||||
return false;
|
||||
return true;
|
||||
}
|
||||
|
||||
void OBSBasic::AddSource(const char *id)
|
||||
{
|
||||
if (id && *id) {
|
||||
OBSBasicSourceSelect sourceSelect(this, id, undo_s);
|
||||
sourceSelect.exec();
|
||||
if (sourceSelect.newSource && strcmp(id, "group") != 0) {
|
||||
if (should_show_properties(sourceSelect.newSource, id)) {
|
||||
CreatePropertiesWindow(sourceSelect.newSource);
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in a new issue