Clean up stylesheet usage

This commit is contained in:
WarmUpTill 2022-01-30 03:37:12 +01:00 committed by WarmUpTill
parent 4e75a15118
commit 727992f1d0
6 changed files with 21 additions and 18 deletions

View File

@ -47,8 +47,7 @@ void deleteLayoutItem(QLayoutItem *item);
void clearLayout(QLayout *layout, int afterIdx = 0);
void setLayoutVisible(QLayout *layout, bool visible);
QMetaObject::Connection PulseWidget(QWidget *widget, QColor startColor,
QColor = QColor(0, 0, 0, 0),
QString specifier = "QLabel ",
QColor endColor = QColor(0, 0, 0, 0),
bool once = false);
void listAddClicked(QListWidget *list, QWidget *newWidget,
QPushButton *addButton = nullptr,

View File

@ -265,8 +265,7 @@ void AdvSceneSwitcher::HighlightAction(int idx)
if (!widget) {
return;
}
PulseWidget(widget, QColor(Qt::green), QColor(0, 0, 0, 0), "QLabel ",
true);
PulseWidget(widget, QColor(Qt::green), QColor(0, 0, 0, 0), true);
}
void AdvSceneSwitcher::HighlightCondition(int idx)
@ -279,8 +278,7 @@ void AdvSceneSwitcher::HighlightCondition(int idx)
if (!widget) {
return;
}
PulseWidget(widget, QColor(Qt::green), QColor(0, 0, 0, 0), "QLabel ",
true);
PulseWidget(widget, QColor(Qt::green), QColor(0, 0, 0, 0), true);
}
void AdvSceneSwitcher::ConnectControlSignals(MacroActionEdit *c)

View File

@ -59,8 +59,10 @@ void Section::SetContent(QWidget *w, bool collapsed)
// Setup contentArea
_contentArea = new QScrollArea(this);
_contentArea->setObjectName("macroSegmentContent");
_contentArea->setSizePolicy(QSizePolicy::Expanding, QSizePolicy::Fixed);
_contentArea->setStyleSheet("QScrollArea { border: none; }");
_contentArea->setStyleSheet(
"#macroSegmentContent { border: none; background-color: rgba(0,0,0,0); }");
_contentArea->setMaximumHeight(0);
_contentArea->setMinimumHeight(0);

View File

@ -13,6 +13,12 @@ StatusControl::StatusControl(QWidget *parent, bool noLayout) : QWidget(parent)
{
_button = new QPushButton("-", this);
_status = new QLabel("-", this);
_status->setStyleSheet("QLabel{ \
border-style: outset; \
border-width: 2px; \
border-radius: 7px; \
border-color: rgb(0,0,0,0) \
}");
_statusPrefix = new QLabel(
obs_module_text(
"AdvSceneSwitcher.generalTab.status.currentStatus"),
@ -87,7 +93,7 @@ void StatusControl::SetStopped()
_status->setText(obs_module_text("AdvSceneSwitcher.status.inactive"));
if (!switcher->disableHints) {
_pulse = PulseWidget(_status, QColor(Qt::red),
QColor(0, 0, 0, 0), "QLabel ");
QColor(0, 0, 0, 0));
}
_setToStopped = true;
}

View File

@ -134,10 +134,16 @@ void AdvSceneSwitcher::setupRandomTab()
ui->randomHelp->setVisible(false);
}
ui->randomDisabledWarning->setStyleSheet("QLabel{ \
border-style: outset; \
border-width: 2px; \
border-radius: 7px; \
border-color: rgb(0,0,0,0) \
}");
if (switcher->switchIfNotMatching != RANDOM_SWITCH) {
if (!switcher->disableHints) {
PulseWidget(ui->randomDisabledWarning, QColor(Qt::red),
QColor(0, 0, 0, 0), "QLabel ");
QColor(0, 0, 0, 0));
}
} else {
ui->randomDisabledWarning->setVisible(false);

View File

@ -881,16 +881,8 @@ bool windowPosValid(QPoint pos)
}
QMetaObject::Connection PulseWidget(QWidget *widget, QColor startColor,
QColor endColor, QString specifier,
bool once)
QColor endColor, bool once)
{
widget->setStyleSheet(specifier + "{ \
border-style: outset; \
border-width: 2px; \
border-radius: 10px; \
border-color: rgb(0,0,0,0) \
}");
QGraphicsColorizeEffect *eEffect = new QGraphicsColorizeEffect(widget);
widget->setGraphicsEffect(eEffect);
QPropertyAnimation *paAnimation =