mirror of
https://github.com/WarmUpTill/SceneSwitcher.git
synced 2026-06-05 07:44:18 -05:00
Clear outdated highlight triggers when enabling macro segment highlights
This commit is contained in:
parent
36fb83246b
commit
6fb8619671
|
|
@ -762,6 +762,16 @@ void AdvSceneSwitcher::HighlightOnChange()
|
|||
}
|
||||
}
|
||||
|
||||
static void resetSegmentHighlights(MacroSegmentList *list)
|
||||
{
|
||||
MacroSegmentEdit *widget = nullptr;
|
||||
for (int i = 0; (widget = list->WidgetAt(i)); i++) {
|
||||
if (widget && widget->Data()) {
|
||||
(void)widget->Data()->GetHighlightAndReset();
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
void AdvSceneSwitcher::on_macroSettings_clicked()
|
||||
{
|
||||
GlobalMacroSettings prop = GetGlobalMacroSettings();
|
||||
|
|
@ -770,8 +780,20 @@ void AdvSceneSwitcher::on_macroSettings_clicked()
|
|||
if (!accepted) {
|
||||
return;
|
||||
}
|
||||
|
||||
GetGlobalMacroSettings() = prop;
|
||||
emit HighlightMacrosChanged(prop._highlightExecuted);
|
||||
|
||||
// Reset highlights to avoid all macro segments being highlighted, which
|
||||
// would have been highlighted at least once since the moment the
|
||||
// highlighting was disabled
|
||||
if (prop._highlightConditions) {
|
||||
resetSegmentHighlights(ui->conditionsList);
|
||||
}
|
||||
if (prop._highlightActions) {
|
||||
resetSegmentHighlights(ui->actionsList);
|
||||
resetSegmentHighlights(ui->elseActionsList);
|
||||
}
|
||||
}
|
||||
|
||||
static void moveControlsToSplitter(QSplitter *splitter, int idx,
|
||||
|
|
|
|||
Loading…
Reference in New Issue
Block a user