Kaynağa Gözat

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.
gxalpha 1 yıl önce
ebeveyn
işleme
175b0cbc83
1 değiştirilmiş dosya ile 12 ekleme ve 0 silme
  1. 12 0
      UI/window-basic-main.cpp

+ 12 - 0
UI/window-basic-main.cpp

@@ -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()