Skip to content

Commit

Permalink
Only create widget when needed
Browse files Browse the repository at this point in the history
  • Loading branch information
exeldro committed Aug 27, 2024
1 parent 19c9e42 commit ed5aba8
Showing 1 changed file with 10 additions and 11 deletions.
21 changes: 10 additions & 11 deletions config-dialog.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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")));
Expand Down Expand Up @@ -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);
}

Expand Down

0 comments on commit ed5aba8

Please sign in to comment.