Browse Source

UI: Focus correct filter list when opening filter view

When the filter view is created, the first item of the asyncFilters list
would be selected (if the source supports asyncFilters) and have its
properties shown.
This means that when no items were in the asyncFilters list, no
properties would be shown, even if an effect filter was present.

Adds a check to focus the effectFilters list in case there are only
effect filters, which makes the correct properties appear.
gxalpha 4 years ago
parent
commit
01d91ee600
1 changed files with 5 additions and 0 deletions
  1. 5 0
      UI/window-basic-filters.cpp

+ 5 - 0
UI/window-basic-filters.cpp

@@ -121,6 +121,11 @@ OBSBasicFilters::OBSBasicFilters(QWidget *parent, OBSSource source_)
 		ui->separatorLine->setVisible(false);
 	}
 
+	if (async && !audioOnly && ui->asyncFilters->count() == 0 &&
+	    ui->effectFilters->count() != 0) {
+		ui->effectFilters->setFocus();
+	}
+
 	if (audioOnly || (audio && !async))
 		ui->asyncLabel->setText(QTStr("Basic.Filters.AudioFilters"));