[ui] Avoid adding empty labels for radio buttons

More places will need it, but this fixes a problem with a large array of
just buttons.
This commit is contained in:
Bill Currie 2023-07-06 19:36:03 +09:00
parent d4b11923b9
commit d8eef0be34

View file

@ -877,9 +877,11 @@ IMUI_Radio (imui_ctx_t *ctx, int *curvalue, int value, const char *label)
set_fill (ctx, punch, ctx->style.background.color[mode]);
}
if (state->label_len) {
auto text = View_New (ctx->vsys, view);
set_control (ctx, text, false);
add_text (ctx, text, state, mode);
}
if (check_button_state (ctx, state->entity)) {
*curvalue = value;