Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

fix(color): mix line source string may be truncated if it is too long. #5916

Merged
merged 1 commit into from
Feb 15, 2025
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
8 changes: 7 additions & 1 deletion radio/src/gui/colorlcd/libui/list_line_button.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,7 @@ InputMixButtonBase::InputMixButtonBase(Window* parent, uint8_t index) :
source = lv_label_create(lvobj);
lv_obj_set_pos(source, SRC_X, SRC_Y);
lv_obj_set_size(source, SRC_W, SRC_H);
etx_font(source, FONT_XS_INDEX, LV_STATE_USER_1);

opts = lv_label_create(lvobj);
lv_obj_set_pos(opts, OPT_X, OPT_Y);
Expand Down Expand Up @@ -103,7 +104,12 @@ void InputMixButtonBase::setWeight(gvar_t value, gvar_t min, gvar_t max)
void InputMixButtonBase::setSource(mixsrc_t idx)
{
char* s = getSourceString(idx);
lv_label_set_text(source, s);
if (getTextWidth(s, 0, FONT(STD)) > SRC_W)
lv_obj_add_state(source, LV_STATE_USER_1);
else
lv_obj_clear_state(source, LV_STATE_USER_1);

lv_label_set_text(source, s);
}

void InputMixButtonBase::setOpts(const char* s)
Expand Down