UI: Move multiview options to view menu
Moves the multiview (fullscreen/window) options to the view menu to reduce context menu clutter, and allow using it even when not in studio mode. Also adds missing translation strings.
This commit is contained in:
parent
3770a24e61
commit
8a38d8e60e
@ -41,6 +41,8 @@ StudioProgramWindow="Windowed Projector (Program)"
|
||||
PreviewWindow="Windowed Projector (Preview)"
|
||||
SceneWindow="Windowed Projector (Scene)"
|
||||
SourceWindow="Windowed Projector (Source)"
|
||||
MultiviewProjector="Multiview (Fullscreen)"
|
||||
MultiviewWindowed="Multiview (Windowed)"
|
||||
Clear="Clear"
|
||||
Revert="Revert"
|
||||
Show="Show"
|
||||
|
@ -1377,6 +1377,9 @@ void OBSBasic::ResetOutputs()
|
||||
}
|
||||
}
|
||||
|
||||
static void AddProjectorMenuMonitors(QMenu *parent, QObject *target,
|
||||
const char *slot);
|
||||
|
||||
#define STARTUP_SEPARATOR \
|
||||
"==== Startup complete ==============================================="
|
||||
#define SHUTDOWN_SEPARATOR \
|
||||
@ -1619,6 +1622,19 @@ void OBSBasic::OBSInit()
|
||||
on_stats_triggered();
|
||||
|
||||
OBSBasicStats::InitializeValues();
|
||||
|
||||
/* ----------------------- */
|
||||
/* Add multiview menu */
|
||||
|
||||
ui->viewMenu->addSeparator();
|
||||
|
||||
QMenu *multiviewProjectorMenu = new QMenu(QTStr("MultiviewProjector"));
|
||||
AddProjectorMenuMonitors(multiviewProjectorMenu, this,
|
||||
SLOT(OpenMultiviewProjector()));
|
||||
ui->viewMenu->addMenu(multiviewProjectorMenu);
|
||||
|
||||
ui->viewMenu->addAction(QTStr("MultiviewWindowed"),
|
||||
this, SLOT(OpenMultiviewWindow()));
|
||||
}
|
||||
|
||||
void OBSBasic::InitHotkeys()
|
||||
@ -3547,33 +3563,31 @@ void OBSBasic::on_scenes_customContextMenuRequested(const QPoint &pos)
|
||||
|
||||
/* ---------------------- */
|
||||
|
||||
if (IsPreviewProgramMode()) {
|
||||
QAction *multiviewAction = popup.addAction(
|
||||
QTStr("ShowInMultiview"));
|
||||
QAction *multiviewAction = popup.addAction(
|
||||
QTStr("ShowInMultiview"));
|
||||
|
||||
OBSSource source = GetCurrentSceneSource();
|
||||
OBSData data = obs_source_get_private_settings(source);
|
||||
obs_data_release(data);
|
||||
OBSSource source = GetCurrentSceneSource();
|
||||
OBSData data = obs_source_get_private_settings(source);
|
||||
obs_data_release(data);
|
||||
|
||||
obs_data_set_default_bool(data, "show_in_multiview",
|
||||
true);
|
||||
bool show = obs_data_get_bool(data, "show_in_multiview");
|
||||
obs_data_set_default_bool(data, "show_in_multiview",
|
||||
true);
|
||||
bool show = obs_data_get_bool(data, "show_in_multiview");
|
||||
|
||||
multiviewAction->setCheckable(true);
|
||||
multiviewAction->setChecked(show);
|
||||
multiviewAction->setCheckable(true);
|
||||
multiviewAction->setChecked(show);
|
||||
|
||||
auto showInMultiview = [this] (OBSData data)
|
||||
{
|
||||
bool show = obs_data_get_bool(data,
|
||||
"show_in_multiview");
|
||||
obs_data_set_bool(data, "show_in_multiview",
|
||||
!show);
|
||||
OBSProjector::UpdateMultiviewProjectors();
|
||||
};
|
||||
auto showInMultiview = [this] (OBSData data)
|
||||
{
|
||||
bool show = obs_data_get_bool(data,
|
||||
"show_in_multiview");
|
||||
obs_data_set_bool(data, "show_in_multiview",
|
||||
!show);
|
||||
OBSProjector::UpdateMultiviewProjectors();
|
||||
};
|
||||
|
||||
connect(multiviewAction, &QAction::triggered,
|
||||
std::bind(showInMultiview, data));
|
||||
}
|
||||
connect(multiviewAction, &QAction::triggered,
|
||||
std::bind(showInMultiview, data));
|
||||
}
|
||||
|
||||
popup.exec(QCursor::pos());
|
||||
@ -3818,7 +3832,6 @@ void OBSBasic::CreateSourcePopupMenu(QListWidgetItem *item, bool preview)
|
||||
QMenu popup(this);
|
||||
QPointer<QMenu> previewProjector;
|
||||
QPointer<QMenu> sourceProjector;
|
||||
QPointer<QMenu> multiviewProjectorMenu;
|
||||
|
||||
if (preview) {
|
||||
QAction *action = popup.addAction(
|
||||
@ -3833,20 +3846,6 @@ void OBSBasic::CreateSourcePopupMenu(QListWidgetItem *item, bool preview)
|
||||
popup.addAction(ui->actionLockPreview);
|
||||
popup.addMenu(ui->scalingMenu);
|
||||
|
||||
if (IsPreviewProgramMode()) {
|
||||
multiviewProjectorMenu = new QMenu(
|
||||
"Multiview Projector");
|
||||
AddProjectorMenuMonitors(multiviewProjectorMenu, this,
|
||||
SLOT(OpenMultiviewProjector()));
|
||||
popup.addMenu(multiviewProjectorMenu);
|
||||
|
||||
QAction *multiviewWindow = popup.addAction(
|
||||
"Multiview Windowed",
|
||||
this, SLOT(OpenMultiviewWindow()));
|
||||
|
||||
popup.addAction(multiviewWindow);
|
||||
}
|
||||
|
||||
previewProjector = new QMenu(QTStr("PreviewProjector"));
|
||||
AddProjectorMenuMonitors(previewProjector, this,
|
||||
SLOT(OpenPreviewProjector()));
|
||||
|
Loading…
x
Reference in New Issue
Block a user