From bb69883bd0b5faf29b2970c4e09accc34dbd6f95 Mon Sep 17 00:00:00 2001 From: gxalpha Date: Thu, 19 May 2022 03:19:40 +0200 Subject: [PATCH] UI: Only show "Interact" menu for interactable sources Most sources can't be interacted with, so always showing this menu only takes up space and makes the menu stack bigger. --- UI/window-basic-main.cpp | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) diff --git a/UI/window-basic-main.cpp b/UI/window-basic-main.cpp index 6efd98e86..e158f5ab6 100644 --- a/UI/window-basic-main.cpp +++ b/UI/window-basic-main.cpp @@ -5566,7 +5566,6 @@ void OBSBasic::CreateSourcePopupMenu(int idx, bool preview) bool isAsyncVideo = (flags & OBS_SOURCE_ASYNC_VIDEO) == OBS_SOURCE_ASYNC_VIDEO; bool hasAudio = (flags & OBS_SOURCE_AUDIO) == OBS_SOURCE_AUDIO; - QAction *action; colorMenu = new QMenu(QTStr("ChangeBG")); colorWidgetAction = new QWidgetAction(colorMenu); @@ -5630,14 +5629,12 @@ void OBSBasic::CreateSourcePopupMenu(int idx, bool preview) popup.addMenu(CreateVisibilityTransitionMenu(false)); popup.addSeparator(); - action = popup.addAction(QTStr("Interact"), this, - SLOT(on_actionInteract_triggered())); - - action->setEnabled(obs_source_get_output_flags(source) & - OBS_SOURCE_INTERACTION); + if (flags & OBS_SOURCE_INTERACTION) + popup.addAction(QTStr("Interact"), this, + SLOT(on_actionInteract_triggered())); popup.addAction(QTStr("Filters"), this, SLOT(OpenFilters())); - action = popup.addAction( + QAction *action = popup.addAction( QTStr("Properties"), this, SLOT(on_actionSourceProperties_triggered())); action->setEnabled(obs_source_configurable(source));