mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-08-11 11:47:41 -05:00
Add option to set and check list source settings by name
This makes it easier to select the intended settings value as the underlying value often has no direct connection to the user facing name. It also makes it possible to select list entries whos underlying value changes frequently, but the user facing value does not. (E.g. device IDs based on the input port compared to the device name)
This commit is contained in:
@@ -6,6 +6,7 @@
|
||||
|
||||
#include <obs-frontend-api.h>
|
||||
#include <QGraphicsColorizeEffect>
|
||||
#include <QListView>
|
||||
#include <QMainWindow>
|
||||
#include <QPropertyAnimation>
|
||||
#include <QScrollBar>
|
||||
@@ -104,6 +105,19 @@ int FindIdxInRagne(QComboBox *list, int start, int stop,
|
||||
return foundIdx;
|
||||
}
|
||||
|
||||
void SetRowVisibleByValue(QComboBox *list, const QString &value, bool show)
|
||||
{
|
||||
int index = list->findText(value);
|
||||
if (index == -1) {
|
||||
return;
|
||||
}
|
||||
|
||||
auto view = qobject_cast<QListView *>(list->view());
|
||||
if (view) {
|
||||
view->setRowHidden(index, !show);
|
||||
}
|
||||
}
|
||||
|
||||
QWidget *GetSettingsWindow()
|
||||
{
|
||||
return SettingsWindowIsOpened() ? AdvSceneSwitcher::window : nullptr;
|
||||
|
||||
Reference in New Issue
Block a user