fix(color): min/max highlight in output list swapped if inverted (#5367)

Use code from output edit page to highlight min/max values on output list page for consistency
This commit is contained in:
philmoz
2024-08-05 10:40:54 +10:00
committed by GitHub
parent 992d2dd3b4
commit d8e4185e31
3 changed files with 8 additions and 14 deletions
@@ -211,16 +211,15 @@ class OutputLineButton : public ListLineButton
if (value != newValue) {
value = newValue;
const LimitData* output = limitAddress(index);
int chanZero = output->ppmCenter;
int chanVal = calcRESXto100(ex_chans[index]);
if (value < chanZero - 5) {
if (chanVal < -DEADBAND) {
lv_obj_add_state(min, ETX_STATE_MINMAX_BOLD);
} else {
lv_obj_clear_state(min, ETX_STATE_MINMAX_BOLD);
}
if (value > chanZero + 5) {
if (chanVal > DEADBAND) {
lv_obj_add_state(max, ETX_STATE_MINMAX_BOLD);
} else {
lv_obj_clear_state(max, ETX_STATE_MINMAX_BOLD);
@@ -30,16 +30,6 @@
#define ETX_STATE_MINMAX_HIGHLIGHT LV_STATE_USER_1
// deadband in % for switching direction of Min/Max text and value field highlighting
// 0 = no deadband
// 1..100 = [-DEADBAND; DEADBAND]
#define DEADBAND 0
// deadband in % for switching direction of Min/Max text and value field highlighting
// 0 = no deadband
// 1..100 = [-DEADBAND; DEADBAND]
#define DEADBAND 0
class OutputEditStatusBar : public Window
{
public:
@@ -24,6 +24,11 @@
#include "page.h"
#include "gvar_numberedit.h"
// deadband in % for switching direction of Min/Max text and value field highlighting
// 0 = no deadband
// 1..100 = [-DEADBAND; DEADBAND]
#define DEADBAND 0
class OutputEditStatusBar;
class OutputEditWindow : public Page