From ed5aba8a7b1cbf0e3034fe77080e1d558962d127 Mon Sep 17 00:00:00 2001 From: Exeldro Date: Tue, 27 Aug 2024 15:19:49 +0200 Subject: [PATCH] Only create widget when needed --- config-dialog.cpp | 21 ++++++++++----------- 1 file changed, 10 insertions(+), 11 deletions(-) diff --git a/config-dialog.cpp b/config-dialog.cpp index 681c7a3..4fa8894 100644 --- a/config-dialog.cpp +++ b/config-dialog.cpp @@ -284,17 +284,6 @@ OBSBasicSettings::OBSBasicSettings(CanvasDock *canvas_dock, QMainWindow *parent) streamingLayout->setFieldGrowthPolicy(QFormLayout::AllNonFixedFieldsGrow); streamingLayout->setLabelAlignment(Qt::AlignRight | Qt::AlignTrailing | Qt::AlignVCenter); - // Multistream is active, show warning - auto multistream_warning_widget = new QGroupBox(obs_frontend_get_locale_string("Warning")); - auto multistream_warning_layout = new QVBoxLayout; - multistream_warning_widget->setStyleSheet("QGroupBox { background: #332701; border: 1px solid #997404; color: #ffda6a; padding-top: 16px; }"); - - auto multistream_warning_label = new QLabel(QString::fromUtf8(obs_module_text("OutputsMulistream"))); - multistream_warning_label->setStyleSheet("color: #ffda6a; font-weight: bold;"); - - multistream_warning_layout->addWidget(multistream_warning_label); - multistream_warning_widget->setLayout(multistream_warning_layout); - auto streaming_title_layout = new QHBoxLayout; auto streaming_title = new QLabel(QString::fromUtf8(obs_module_text("Streaming"))); @@ -507,6 +496,16 @@ OBSBasicSettings::OBSBasicSettings(CanvasDock *canvas_dock, QMainWindow *parent) // multistream is active, show warning if (canvasDock->disable_stream_settings) { + auto multistream_warning_widget = new QGroupBox(QString::fromUtf8(obs_frontend_get_locale_string("Warning"))); + auto multistream_warning_layout = new QVBoxLayout; + multistream_warning_widget->setStyleSheet( + "QGroupBox { background: #332701; border: 1px solid #997404; color: #ffda6a; padding-top: 16px; }"); + + auto multistream_warning_label = new QLabel(QString::fromUtf8(obs_module_text("OutputsMulistream"))); + multistream_warning_label->setStyleSheet("color: #ffda6a; font-weight: bold;"); + + multistream_warning_layout->addWidget(multistream_warning_label); + multistream_warning_widget->setLayout(multistream_warning_layout); vb->addWidget(multistream_warning_widget); }