fix(color): preview may not work when editing customisable switch colors in radio setup (#6714)

This commit is contained in:
philmoz
2025-10-25 09:20:57 +10:00
committed by GitHub
parent d95bbf1ebd
commit 65bf15f18c
4 changed files with 35 additions and 20 deletions
@@ -136,6 +136,7 @@ class FunctionSwitch : public Window
g_model.cfsOffColor(switchIndex).setColor(newValue);
offValue = g_model.cfsOffColor(switchIndex);
setFSEditOverride(-1, 0);
SET_DIRTY();
},
[=](int newValue) { previewColor(newValue); }, ETX_RGB888);
@@ -154,6 +155,7 @@ class FunctionSwitch : public Window
g_model.cfsOnColor(switchIndex).setColor(newValue);
onValue = g_model.cfsOnColor(switchIndex);
setFSEditOverride(-1, 0);
SET_DIRTY();
},
[=](int newValue) { previewColor(newValue); }, ETX_RGB888);
@@ -240,11 +242,7 @@ class FunctionSwitch : public Window
{
// Convert color index to RGB
newValue = color32ToRGB(newValue);
if (g_model.cfsState(switchIndex)) {
g_model.cfsOnColor(switchIndex).setColor(newValue);
} else {
g_model.cfsOffColor(switchIndex).setColor(newValue);
}
setFSEditOverride(switchIndex, newValue);
}
#endif
+3 -5
View File
@@ -106,6 +106,7 @@ class RadioFunctionSwitch : public Window
g_eeGeneral.switchOffColor(switchIndex).setColor(newValue);
offValue = g_eeGeneral.switchOffColor(switchIndex);
setFSEditOverride(-1, 0);
SET_DIRTY();
},
[=](int newValue) { previewColor(newValue); }, ETX_RGB888);
@@ -124,6 +125,7 @@ class RadioFunctionSwitch : public Window
g_eeGeneral.switchOnColor(switchIndex).setColor(newValue);
onValue = g_eeGeneral.switchOnColor(switchIndex);
setFSEditOverride(-1, 0);
SET_DIRTY();
},
[=](int newValue) { previewColor(newValue); }, ETX_RGB888);
@@ -209,11 +211,7 @@ class RadioFunctionSwitch : public Window
{
// Convert color index to RGB
newValue = color32ToRGB(newValue);
if (g_model.cfsState(switchIndex)) {
g_eeGeneral.switchOnColor(switchIndex).setColor(newValue);
} else {
g_eeGeneral.switchOffColor(switchIndex).setColor(newValue);
}
setFSEditOverride(switchIndex, newValue);
}
#endif