Refactor widget highlighting

This commit is contained in:
WarmUpTill
2024-06-02 16:10:15 +02:00
committed by WarmUpTill
parent d72a0c0d38
commit c05a92d417
28 changed files with 112 additions and 106 deletions

View File

@@ -9,7 +9,7 @@
namespace advss {
bool RandomSwitch::pause = false;
static QMetaObject::Connection addPulse;
static QObject *addPulse = nullptr;
void AdvSceneSwitcher::on_randomAdd_clicked()
{
@@ -19,7 +19,7 @@ void AdvSceneSwitcher::on_randomAdd_clicked()
listAddClicked(ui->randomSwitches,
new RandomSwitchWidget(this,
&switcher->randomSwitches.back()),
ui->randomAdd, &addPulse);
ui->randomAdd, addPulse);
ui->randomHelp->setVisible(false);
}
@@ -131,8 +131,8 @@ void AdvSceneSwitcher::SetupRandomTab()
if (switcher->randomSwitches.size() == 0) {
if (!switcher->disableHints) {
addPulse =
PulseWidget(ui->randomAdd, QColor(Qt::green));
addPulse = HighlightWidget(ui->randomAdd,
QColor(Qt::green));
}
ui->randomHelp->setVisible(true);
} else {
@@ -147,8 +147,8 @@ void AdvSceneSwitcher::SetupRandomTab()
}");
if (switcher->switchIfNotMatching != NoMatchBehavior::RANDOM_SWITCH) {
if (!switcher->disableHints) {
PulseWidget(ui->randomDisabledWarning, QColor(Qt::red),
QColor(0, 0, 0, 0));
HighlightWidget(ui->randomDisabledWarning,
QColor(Qt::red), QColor(0, 0, 0, 0));
}
} else {
ui->randomDisabledWarning->setVisible(false);