[ui] Skip checkbox label if zero length

I seem to remember doing this for radio buttons, I guess I forgot about
checkboxes (really need to unify the code, though).
This commit is contained in:
Bill Currie 2023-07-21 19:28:30 +09:00
parent 8ae150cb9e
commit ef322b968a

View file

@ -1007,9 +1007,11 @@ IMUI_Checkbox (imui_ctx_t *ctx, bool *flag, const char *label)
set_fill (ctx, punch, ctx->style.background.color[mode]);
}
auto text = View_New (ctx->vsys, view);
set_control (ctx, text, false);
add_text (ctx, text, state, 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)) {
*flag = !*flag;