Skip to content

Commit 144c208

Browse files
committed
Add scene filter option
1 parent 70707e2 commit 144c208

File tree

2 files changed

+19
-1
lines changed

2 files changed

+19
-1
lines changed

CMakeLists.txt

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -21,7 +21,7 @@ add_library(${PROJECT_NAME} MODULE)
2121
configure_file(${CMAKE_CURRENT_SOURCE_DIR}/version.h.in ${CMAKE_CURRENT_SOURCE_DIR}/version.h)
2222

2323
target_sources(${PROJECT_NAME} PRIVATE
24-
source-copy.cpp
24+
source-copy.cpp
2525
source-copy.hpp
2626
obs-websocket-api.h
2727
version.h)

source-copy.cpp

Lines changed: 18 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@
77
#include <QMainWindow>
88
#include <QMenu>
99
#include <QWidgetAction>
10+
#include <QLineEdit>
1011

1112
#include "version.h"
1213
#include "util/config-file.h"
@@ -335,6 +336,23 @@ static void LoadMenu(QMenu *menu)
335336

336337
struct obs_frontend_source_list scenes = {};
337338
obs_frontend_get_scenes(&scenes);
339+
wa = new QWidgetAction(menu);
340+
auto t = new QLineEdit;
341+
t->connect(t, &QLineEdit::textChanged, [menu](const QString text) {
342+
foreach(auto action, menu->actions())
343+
{
344+
if (!action->menu())
345+
continue;
346+
if (text.isEmpty() || action->text() == QT_UTF8(obs_module_text("Scripts"))) {
347+
action->setVisible(true);
348+
} else {
349+
action->setVisible(action->text().contains(text, Qt::CaseInsensitive));
350+
}
351+
}
352+
});
353+
wa->setDefaultWidget(t);
354+
menu->addAction(wa);
355+
338356
for (size_t i = 0; i < scenes.sources.num; i++) {
339357
obs_source_t *source = scenes.sources.array[i];
340358
QMenu *submenu = menu->addMenu(obs_source_get_name(scenes.sources.array[i]));

0 commit comments

Comments
 (0)
pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy