From ef322b968af1e439846ec161bd4c009813cf2dcc Mon Sep 17 00:00:00 2001 From: Bill Currie Date: Fri, 21 Jul 2023 19:28:30 +0900 Subject: [PATCH] [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). --- libs/ui/imui.c | 8 +++++--- 1 file changed, 5 insertions(+), 3 deletions(-) diff --git a/libs/ui/imui.c b/libs/ui/imui.c index 26489240d..460bb0db8 100644 --- a/libs/ui/imui.c +++ b/libs/ui/imui.c @@ -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;