From 56ff3b2995ae949140543203c40d9147a6e0e09a Mon Sep 17 00:00:00 2001 From: philmoz Date: Sun, 27 Apr 2025 14:46:43 +1000 Subject: [PATCH] fix(color): channel bars on outputs list not correct size if extended limits setting changed (#6157) --- radio/src/gui/colorlcd/controls/channel_bar.cpp | 6 ++++-- radio/src/gui/colorlcd/controls/channel_bar.h | 1 + 2 files changed, 5 insertions(+), 2 deletions(-) diff --git a/radio/src/gui/colorlcd/controls/channel_bar.cpp b/radio/src/gui/colorlcd/controls/channel_bar.cpp index 796521c48..07e089ab6 100644 --- a/radio/src/gui/colorlcd/controls/channel_bar.cpp +++ b/radio/src/gui/colorlcd/controls/channel_bar.cpp @@ -70,7 +70,7 @@ void ChannelBar::checkEvents() int newValue = getValue(); - if (value != newValue) { + if (value != newValue || extendedLimits != g_model.extendedLimits) { value = newValue; std::string s; @@ -81,7 +81,7 @@ void ChannelBar::checkEvents() else s = formatNumberAsString(calcRESXto100(value), 0, 0, "", "%"); - if (s != valStr) { + if (s != valStr || extendedLimits != g_model.extendedLimits) { valStr = s; lv_label_set_text(valText, s.c_str()); @@ -100,6 +100,8 @@ void ChannelBar::checkEvents() lv_obj_set_pos(bar, x, 0); lv_obj_set_size(bar, size, height()); } + + extendedLimits = g_model.extendedLimits; } } diff --git a/radio/src/gui/colorlcd/controls/channel_bar.h b/radio/src/gui/colorlcd/controls/channel_bar.h index e30f15b7c..a1d6cf58d 100644 --- a/radio/src/gui/colorlcd/controls/channel_bar.h +++ b/radio/src/gui/colorlcd/controls/channel_bar.h @@ -40,6 +40,7 @@ class ChannelBar : public Window protected: uint8_t channel = 0; int16_t value = -10000; + bool extendedLimits = false; std::string valStr; std::function getValue; lv_obj_t* valText = nullptr;