Fix macro segment highlighting not being in sync

Each macro segment had its own internal timer to handle highlighting.
This handing was now moved centrally to the macro tab.
This commit is contained in:
WarmUpTill
2024-05-08 22:44:45 +02:00
committed by WarmUpTill
parent a360d53419
commit 8f55856fd5
7 changed files with 55 additions and 56 deletions

View File

@@ -137,37 +137,37 @@ bool Macro::CeckMatch()
case LogicType::AND:
_matched = _matched && cond;
if (cond) {
c->SetHighlight();
c->EnableHighlight();
}
break;
case LogicType::OR:
_matched = _matched || cond;
if (cond) {
c->SetHighlight();
c->EnableHighlight();
}
break;
case LogicType::AND_NOT:
_matched = _matched && !cond;
if (!cond) {
c->SetHighlight();
c->EnableHighlight();
}
break;
case LogicType::OR_NOT:
_matched = _matched || !cond;
if (!cond) {
c->SetHighlight();
c->EnableHighlight();
}
break;
case LogicType::ROOT_NONE:
_matched = cond;
if (cond) {
c->SetHighlight();
c->EnableHighlight();
}
break;
case LogicType::ROOT_NOT:
_matched = !cond;
if (!cond) {
c->SetHighlight();
c->EnableHighlight();
}
break;
default:
@@ -313,7 +313,7 @@ bool Macro::RunActionsHelper(
break;
}
if (action->Enabled()) {
action->SetHighlight();
action->EnableHighlight();
}
}
_done = true;
@@ -819,10 +819,10 @@ void Macro::ResetUIHelpers()
{
_onPreventedActionExecution = false;
for (auto c : _conditions) {
c->Highlight();
c->GetHighlightAndReset();
}
for (auto a : _actions) {
a->Highlight();
a->GetHighlightAndReset();
}
}