Skip to content

Commit

Permalink
UI: Regroup and Reorder source right-click menus
Browse files Browse the repository at this point in the history
Visually, the Scale Filtering, Blending Mode & Method, and Deinterlacing
menus are now grouped together, with "Hide in Mixer" being its own group
until a better place for it has been found.
Projector and Screenshot menus have been moved down.

As a related code cleanup, the creation of sourceProjector and
sourceWindow has been moved down and partially inlined.
  • Loading branch information
gxalpha authored and GeorgesStavracas committed Jun 20, 2022
1 parent bb69883 commit 889ca0f
Showing 1 changed file with 17 additions and 25 deletions.
42 changes: 17 additions & 25 deletions UI/window-basic-main.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5577,19 +5577,10 @@ void OBSBasic::CreateSourcePopupMenu(int idx, bool preview)
popup.addAction(QTStr("Remove"), this,
SLOT(on_actionRemoveSource_triggered()));
popup.addSeparator();
popup.addMenu(ui->orderMenu);

popup.addMenu(ui->orderMenu);
popup.addMenu(ui->transformMenu);

sourceProjector = new QMenu(QTStr("SourceProjector"));
AddProjectorMenuMonitors(sourceProjector, this,
SLOT(OpenSourceProjector()));

QAction *sourceWindow = popup.addAction(
QTStr("SourceWindow"), this, SLOT(OpenSourceWindow()));

popup.addAction(sourceWindow);

popup.addSeparator();

if (hasAudio) {
Expand All @@ -5598,37 +5589,38 @@ void OBSBasic::CreateSourcePopupMenu(int idx, bool preview)
SLOT(ToggleHideMixer()));
actionHideMixer->setCheckable(true);
actionHideMixer->setChecked(SourceMixerHidden(source));
}

if (isAsyncVideo) {
deinterlaceMenu = new QMenu(QTStr("Deinterlacing"));
popup.addMenu(
AddDeinterlacingMenu(deinterlaceMenu, source));
popup.addSeparator();
}

scaleFilteringMenu = new QMenu(QTStr("ScaleFiltering"));
popup.addMenu(
AddScaleFilteringMenu(scaleFilteringMenu, sceneItem));
popup.addSeparator();

blendingModeMenu = new QMenu(QTStr("BlendingMode"));
popup.addMenu(AddBlendingModeMenu(blendingModeMenu, sceneItem));
blendingMethodMenu = new QMenu(QTStr("BlendingMethod"));
popup.addMenu(
AddBlendingMethodMenu(blendingMethodMenu, sceneItem));
blendingModeMenu = new QMenu(QTStr("BlendingMode"));
popup.addMenu(AddBlendingModeMenu(blendingModeMenu, sceneItem));
if (isAsyncVideo) {
deinterlaceMenu = new QMenu(QTStr("Deinterlacing"));
popup.addMenu(
AddDeinterlacingMenu(deinterlaceMenu, source));
}
popup.addSeparator();

popup.addMenu(CreateVisibilityTransitionMenu(true));
popup.addMenu(CreateVisibilityTransitionMenu(false));
popup.addSeparator();

sourceProjector = new QMenu(QTStr("SourceProjector"));
AddProjectorMenuMonitors(sourceProjector, this,
SLOT(OpenSourceProjector()));
popup.addMenu(sourceProjector);
popup.addAction(sourceWindow);
popup.addAction(QTStr("SourceWindow"), this,
SLOT(OpenSourceWindow()));
popup.addAction(QTStr("Screenshot.Source"), this,
SLOT(ScreenshotSelectedSource()));
popup.addSeparator();

popup.addMenu(CreateVisibilityTransitionMenu(true));
popup.addMenu(CreateVisibilityTransitionMenu(false));
popup.addSeparator();

if (flags & OBS_SOURCE_INTERACTION)
popup.addAction(QTStr("Interact"), this,
SLOT(on_actionInteract_triggered()));
Expand Down

0 comments on commit 889ca0f

Please sign in to comment.