Ver Fonte

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 há 2 anos atrás
pai
commit
d08ede33cd
1 ficheiros alterados com 6 adições e 2 exclusões
  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)