diff --git a/docs/changes.md b/docs/changes.md index 541920cb2..382c73ddd 100644 --- a/docs/changes.md +++ b/docs/changes.md @@ -3,6 +3,7 @@ * 2020/06/10 * 增加宏 NATIVE_WINDOW_BORDERLESS 控制是否去掉 native window 的标题栏。 * 增加 FAQ《应用程序在 Windows 的手持设备中运行,如何去掉窗口的标题栏》 + * image value 支持16进制格式。 * 2020/06/09 * 增加 dll 导出函数(感谢俊杰提供补丁)。 diff --git a/src/ext_widgets/image_value/image_value.c b/src/ext_widgets/image_value/image_value.c index 64e639095..d946d718e 100644 --- a/src/ext_widgets/image_value/image_value.c +++ b/src/ext_widgets/image_value/image_value.c @@ -73,7 +73,7 @@ static ret_t image_value_on_paint_self(widget_t* widget, canvas_t* c) { memset(bitmap, 0x00, sizeof(bitmap)); memset(sub_name, 0x00, sizeof(sub_name)); - if (strchr(format, 'd') != NULL) { + if (strchr(format, 'd') != NULL || strchr(format, 'x') != NULL || strchr(format, 'X') != NULL) { tk_snprintf(str, IMAGE_VALUE_MAX_CHAR_NR, format, tk_roundi(image_value->value)); } else { tk_snprintf(str, IMAGE_VALUE_MAX_CHAR_NR, format, image_value->value);