浏览代码

UI: Disable screenshot action if item has no video

This disables the source screenshot action in the context menu
if the source has no video.
cg2121 2 年之前
父节点
当前提交
d08ede33cd
共有 1 个文件被更改,包括 6 次插入2 次删除
  1. 6 2
      UI/window-basic-main.cpp

+ 6 - 2
UI/window-basic-main.cpp

@@ -5689,8 +5689,12 @@ void OBSBasic::CreateSourcePopupMenu(int idx, bool preview)
 		popup.addMenu(sourceProjector);
 		popup.addAction(QTStr("SourceWindow"), this,
 				SLOT(OpenSourceWindow()));
-		popup.addAction(QTStr("Screenshot.Source"), this,
-				SLOT(ScreenshotSelectedSource()));
+
+		QAction *screenshotAction =
+			popup.addAction(QTStr("Screenshot.Source"), this,
+					SLOT(ScreenshotSelectedSource()));
+		screenshotAction->setEnabled(flags & OBS_SOURCE_VIDEO);
+
 		popup.addSeparator();
 
 		if (flags & OBS_SOURCE_INTERACTION)