Skip to content

Commit

Permalink
fix(color): model info widget may display extra character after model…
Browse files Browse the repository at this point in the history
… name (#5933)
  • Loading branch information
philmoz authored Feb 20, 2025
1 parent e22088f commit 16a7d02
Showing 1 changed file with 6 additions and 3 deletions.
9 changes: 6 additions & 3 deletions radio/src/gui/colorlcd/widgets/modelbmp.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -38,7 +38,9 @@ class ModelBitmapWidget : public Widget
etx_obj_add_style(lvobj, styles->bg_opacity_cover,
LV_PART_MAIN | ETX_STATE_BG_FILL);

label = new StaticText(this, rect_t{}, g_model.header.name);
char s[LEN_MODEL_NAME + 1];
strAppend(s, g_model.header.name, LEN_MODEL_NAME);
label = new StaticText(this, rect_t{}, s);
label->hide();

image = new StaticImage(this, rect_t{0, 0, width(), height()});
Expand All @@ -57,8 +59,9 @@ class ModelBitmapWidget : public Widget
invalidate();
}

if (label->getText() != g_model.header.name)
label->setText(g_model.header.name);
char s[LEN_MODEL_NAME + 1];
strAppend(s, g_model.header.name, LEN_MODEL_NAME);
label->setText(s);
}

void update() override
Expand Down

0 comments on commit 16a7d02

Please sign in to comment.