diff --git a/config-dialog.cpp b/config-dialog.cpp index a9b5e06..3c170a4 100644 --- a/config-dialog.cpp +++ b/config-dialog.cpp @@ -88,6 +88,38 @@ OBSBasicSettings::OBSBasicSettings(QMainWindow *parent) : QDialog(parent) settingsPages->setLineWidth(0); QWidget *generalPage = new QWidget; + auto generalPageLayout = new QVBoxLayout; + generalPage->setLayout(generalPageLayout); + + auto infoBox = ConfigUtils::generateSettingsGroupBox(QString::fromUtf8(obs_module_text("WelcomeTitle"))); + infoBox->setStyleSheet("padding-top: 12px"); + auto infoLayout = new QVBoxLayout; + infoBox->setLayout(infoLayout); + + auto infoLabel = new QLabel(QString::fromUtf8(obs_module_text("WelcomeText"))); + infoLabel->setWordWrap(true); + infoLayout->addWidget(infoLabel, 1); + + auto buttonGroupBox = new QWidget(); + auto buttonLayout = new QHBoxLayout; + buttonLayout->setSpacing(8); + buttonLayout->setAlignment(Qt::AlignCenter); + + auto mainButton = ConfigUtils::generateMenuButton(QString::fromUtf8(obs_module_text("SettingsMainOutputsButton")), QIcon(QString::fromUtf8(":/settings/images/settings/stream.svg"))); + auto verticalButton = ConfigUtils::generateMenuButton(QString::fromUtf8(obs_module_text("SettingsVerticalOutputsButton")), QIcon(QString::fromUtf8(":/settings/images/settings/stream.svg"))); + auto helpButton = ConfigUtils::generateMenuButton(QString::fromUtf8(obs_module_text("SettingsHelpButton")), main_window->property("defaultIcon").value()); + + buttonLayout->addWidget(mainButton, 0); + buttonLayout->addWidget(verticalButton, 0); + buttonLayout->addWidget(helpButton, 0); + + buttonGroupBox->setLayout(buttonLayout); + + generalPageLayout->addWidget(infoBox, 0); + generalPageLayout->addWidget(buttonGroupBox, 1); + + + QScrollArea *scrollArea = new QScrollArea; scrollArea->setWidget(generalPage); scrollArea->setWidgetResizable(true); @@ -201,7 +233,7 @@ OBSBasicSettings::OBSBasicSettings(QMainWindow *parent) : QDialog(parent) serverLayout->setLabelAlignment(Qt::AlignRight | Qt::AlignTrailing | Qt::AlignVCenter); auto mainTitle = new QLabel(QString::fromUtf8(obs_module_text("SettingsMainCanvasTitle"))); - mainTitle->setStyleSheet(QString::fromUtf8("font-weight: bold;")); + mainTitle->setStyleSheet("font-weight: bold;"); serverLayout->addRow(mainTitle); auto mainDescription = new QLabel(QString::fromUtf8(obs_module_text("SettingsMainCanvasDescription"))); @@ -296,13 +328,26 @@ OBSBasicSettings::OBSBasicSettings(QMainWindow *parent) : QDialog(parent) contentLayout->addWidget(settingsPages, 1); listWidget->connect(listWidget, &QListWidget::currentRowChanged, settingsPages, &QStackedWidget::setCurrentIndex); - listWidget->setCurrentRow(1); + listWidget->setCurrentRow(0); QVBoxLayout *vlayout = new QVBoxLayout; vlayout->setContentsMargins(11, 11, 11, 11); vlayout->addLayout(contentLayout); vlayout->addLayout(bottomLayout); setLayout(vlayout); + + // Button connects for general page, clean this up in the future when we abstract pages + connect(mainButton, &QPushButton::clicked, [this] { + listWidget->setCurrentRow(1); + }); + + connect(verticalButton, &QPushButton::clicked, [this] { + listWidget->setCurrentRow(2); + }); + + connect(helpButton, &QPushButton::clicked, [this] { + listWidget->setCurrentRow(listWidget->count() - 1); + }); } OBSBasicSettings::~OBSBasicSettings() diff --git a/config-utils.cpp b/config-utils.cpp index 778edd3..fde3319 100644 --- a/config-utils.cpp +++ b/config-utils.cpp @@ -8,6 +8,7 @@ #include #include #include +#include #include "obs.h" #include "obs-module.h" @@ -25,6 +26,30 @@ QPushButton *ConfigUtils::generateButton(QString buttonText) { return button; } +// Generate settings groupbox +QGroupBox *ConfigUtils::generateSettingsGroupBox(QString headingText) { + auto group = headingText == nullptr ? new QGroupBox : new QGroupBox(headingText); +// group->setProperty("altColor", QVariant(true)); + + return group; +} + +// Generate menu button +QToolButton *ConfigUtils::generateMenuButton(QString title, QIcon icon) { + auto button = new QToolButton; + + button->setText(title); + button->setIcon(icon); + button->setIconSize(QSize(32, 32)); + button->setToolButtonStyle(Qt::ToolButtonTextUnderIcon); + button->setStyleSheet( + "min-width: 110px; max-width: 110px; min-height: 90px; max-height: 90px; padding-top: 16px; font-weight: bold;"); + + return button; +} + + + // For setting the active property stuff on buttons void ConfigUtils::updateButtonStyles(QPushButton *defaultButton, QPushButton *customButton, int activeIndex) { defaultButton->setProperty("unselected", activeIndex != 0 ? true : false); diff --git a/config-utils.hpp b/config-utils.hpp index 90ffec0..e67acb8 100644 --- a/config-utils.hpp +++ b/config-utils.hpp @@ -8,11 +8,19 @@ #include #include #include +#include #include "obs.h" class ConfigUtils { public: + // UI generation static QPushButton *generateButton(QString buttonText); + static QGroupBox *generateSettingsGroupBox(QString headingText); + static QToolButton *generateMenuButton(QString title, QIcon icon); + + + + static void updateButtonStyles(QPushButton *defaultButton, QPushButton *customButton, int activeIndex); diff --git a/data/locale/en-US.ini b/data/locale/en-US.ini index 5c5f612..5d42fcf 100644 --- a/data/locale/en-US.ini +++ b/data/locale/en-US.ini @@ -38,6 +38,13 @@ NewVersion="New version (%1) available Click here to download the latest version." # Config dialog +WelcomeTitle="Welcome to Aitum Multistream!" +WelcomeText="Multistreaming from OBS just got a whole lot easier.\n\nTo start configuring your outputs for both the main canvas and the vertical canvas (if you use Vertical), click one of the buttons below.\n\nIf you need help, please visit the help page for more information." +SettingsMainOutputsButton="Main Outputs" +SettingsVerticalOutputsButton="Vertical Outputs" +SettingsHelpButton="Help" + + SettingsMainCanvasTitle="Main Canvas" SettingsMainCanvasDescription="You can manage your Main Canvas (the default canvas) settings here. \nPlease note that to change your Built-in Output settings, you need to do this from within the normal OBS settings."