From f2985dc8a25d71be6ace308d25824bf104624d33 Mon Sep 17 00:00:00 2001 From: Christian Soffke Date: Wed, 9 Sep 2026 11:22:57 +0200 Subject: [PATCH] option_get_valuestring: fix trailing whitespace for UNIT_INT Remove trailing whitespace from int settings, so that right-aligned or centered values look correct in Quickscreen for settings such as Brightness. Change-Id: I006cf3c3e8b30be2246e7370f26e0428fa47e54b --- apps/gui/option_select.c | 7 ++++++- 1 file changed, 6 insertions(+), 1 deletion(-) diff --git a/apps/gui/option_select.c b/apps/gui/option_select.c index 12dff945ad..d70af4d042 100644 --- a/apps/gui/option_select.c +++ b/apps/gui/option_select.c @@ -108,7 +108,12 @@ const char *option_get_valuestring(const struct settings_list *setting, if (formatter) str = formatter(buffer, buf_len, (int)temp_var, str_unit); else if (!is_time_setting) - snprintf(buffer, buf_len, "%d %s", (int)temp_var, str_unit?str_unit:""); + { + if (str_unit && str_unit[0]) + snprintf(buffer, buf_len, "%d %s", (int)temp_var, str_unit); + else + snprintf(buffer, buf_len, "%d", (int)temp_var); + } } else if (HASFLAG(setting, F_T_SOUND)) {