fix(color): preview may not work when editing customisable switch colors in radio setup (#6714)
This commit is contained in:
@@ -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
|
||||
|
||||
|
||||
@@ -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
|
||||
|
||||
|
||||
Reference in New Issue
Block a user