clang format

This commit is contained in:
Exeldro 2024-07-29 16:46:37 +02:00
parent 71b0e6e123
commit 4328ce7d91
No known key found for this signature in database
GPG Key ID: 97269A83FC715751
3 changed files with 14 additions and 19 deletions

View File

@ -15,9 +15,9 @@
#include "obs-frontend-api.h"
#include <util/dstr.h>
// Generate buttons for default/custom stuff
QPushButton *ConfigUtils::generateButton(QString buttonText) {
QPushButton *ConfigUtils::generateButton(QString buttonText)
{
auto styles = QString::fromUtf8("QPushButton[unselected=\"true\"] { background: pink; }");
auto button = new QPushButton(buttonText);
@ -27,15 +27,17 @@ QPushButton *ConfigUtils::generateButton(QString buttonText) {
}
// Generate settings groupbox
QGroupBox *ConfigUtils::generateSettingsGroupBox(QString headingText) {
QGroupBox *ConfigUtils::generateSettingsGroupBox(QString headingText)
{
auto group = headingText == nullptr ? new QGroupBox : new QGroupBox(headingText);
// group->setProperty("altColor", QVariant(true));
// group->setProperty("altColor", QVariant(true));
return group;
}
// Generate menu button
QToolButton *ConfigUtils::generateMenuButton(QString title, QIcon icon) {
QToolButton *ConfigUtils::generateMenuButton(QString title, QIcon icon)
{
auto button = new QToolButton;
button->setText(title);
@ -48,21 +50,19 @@ QToolButton *ConfigUtils::generateMenuButton(QString title, QIcon icon) {
return button;
}
// For setting the active property stuff on buttons
void ConfigUtils::updateButtonStyles(QPushButton *defaultButton, QPushButton *customButton, int activeIndex) {
void ConfigUtils::updateButtonStyles(QPushButton *defaultButton, QPushButton *customButton, int activeIndex)
{
defaultButton->setProperty("unselected", activeIndex != 0 ? true : false);
customButton->setProperty("unselected", activeIndex != 1 ? true : false);
}
// Platform icons deciphered from endpoints
QIcon ConfigUtils::getPlatformIconFromEndpoint(QString endpoint)
{
if (endpoint.contains(QString::fromUtf8(".contribute.live-video.net")) ||
endpoint.contains(QString::fromUtf8(".twitch.tv"))) { // twitch
endpoint.contains(QString::fromUtf8(".twitch.tv"))) { // twitch
return QIcon(":/aitum/media/twitch.png");
} else if (endpoint.contains(QString::fromUtf8(".youtube.com"))) { // youtube
return QIcon(":/aitum/media/youtube.png");

View File

@ -18,11 +18,7 @@ public:
static QGroupBox *generateSettingsGroupBox(QString headingText);
static QToolButton *generateMenuButton(QString title, QIcon icon);
static void updateButtonStyles(QPushButton *defaultButton, QPushButton *customButton, int activeIndex);
static QIcon getPlatformIconFromEndpoint(QString endpoint);
};

View File

@ -50,7 +50,6 @@ private:
QIcon streamActiveIcon = QIcon(":/aitum/media/streaming.svg");
QIcon streamInactiveIcon = QIcon(":/aitum/media/stream.svg");
static void frontend_event(enum obs_frontend_event event, void *private_data);
static void stream_output_stop(void *data, calldata_t *calldata);