0
0
mirror of https://github.com/obsproject/obs-studio.git synced 2024-09-20 04:42:18 +02:00

UI: Update edit menu on source filter changes

Currently, when adding a filter to a source and then right-clicking it
or using the menu bar edit menu, it's not possible to copy the source's
filters. This is because the edit menu does not update on filter
changes.
Listening to the new global filters add/remove signal and updating the
edit menu will enable the copy option if a filter get added or disable
the option if the last filter gets removed.
This commit is contained in:
gxalpha 2024-05-25 13:43:59 +02:00 committed by Lain
parent a1e0626c14
commit 175b0cbc83

View File

@ -1866,6 +1866,18 @@ void OBSBasic::InitOBSCallbacks()
OBSBasic::SourceAudioDeactivated, this);
signalHandlers.emplace_back(obs_get_signal_handler(), "source_rename",
OBSBasic::SourceRenamed, this);
signalHandlers.emplace_back(
obs_get_signal_handler(), "source_filter_add",
[](void *data, calldata_t *) {
static_cast<OBSBasic *>(data)->UpdateEditMenu();
},
this);
signalHandlers.emplace_back(
obs_get_signal_handler(), "source_filter_remove",
[](void *data, calldata_t *) {
static_cast<OBSBasic *>(data)->UpdateEditMenu();
},
this);
}
void OBSBasic::InitPrimitives()