From 338e9edcf87ee725acf56d01135b0529c1e98803 Mon Sep 17 00:00:00 2001 From: xianjimli Date: Wed, 27 Jun 2018 17:08:54 +0800 Subject: [PATCH] bugs fix and update docs --- README.md | 3 +++ src/base/edit.c | 2 +- src/base/progress_bar.c | 2 +- src/base/suggest_words.c | 1 + 4 files changed, 6 insertions(+), 2 deletions(-) diff --git a/README.md b/README.md index 1b1a6437a..17cf07c4d 100755 --- a/README.md +++ b/README.md @@ -137,6 +137,9 @@ bin\demoui [TODO.md](TODO.md) ## 最新动态 +* 2018/06/27 + * 实现输入法的联想字功能。 + * 2018/06/26 * 更新aworks工程并测试。 * 增加小工具用于生成输入法联想词库。 diff --git a/src/base/edit.c b/src/base/edit.c index 47bbc831a..153ae7adc 100644 --- a/src/base/edit.c +++ b/src/base/edit.c @@ -69,7 +69,7 @@ static ret_t edit_on_paint_self(widget_t* widget, canvas_t* c) { wh_t w = widget->w - 2 * margin; color_t trans = color_init(0, 0, 0, 0); color_t tc = style_get_color(style, STYLE_ID_TEXT_COLOR, trans); - uint16_t font_size = style_get_int(style, STYLE_ID_FONT_SIZE, 20); + uint16_t font_size = style_get_int(style, STYLE_ID_FONT_SIZE, TK_DEFAULT_FONT_SIZE); const char* font_name = style_get_str(style, STYLE_ID_FONT_NAME, NULL); canvas_set_text_color(c, tc); diff --git a/src/base/progress_bar.c b/src/base/progress_bar.c index 2e8ee1456..2f26e881d 100644 --- a/src/base/progress_bar.c +++ b/src/base/progress_bar.c @@ -109,7 +109,7 @@ static ret_t progress_bar_on_paint_self(widget_t* widget, canvas_t* c) { uint32_t i = 0; wchar_t str[32]; uint32_t len = 0; - uint16_t font_size = style_get_int(style, STYLE_ID_FONT_SIZE, 20); + uint16_t font_size = style_get_int(style, STYLE_ID_FONT_SIZE, TK_DEFAULT_FONT_SIZE); const char* font_name = style_get_str(style, STYLE_ID_FONT_NAME, NULL); tk_itoa(s, sizeof(s), progress_bar->value); diff --git a/src/base/suggest_words.c b/src/base/suggest_words.c index 51dae1254..bbf9632cf 100644 --- a/src/base/suggest_words.c +++ b/src/base/suggest_words.c @@ -117,6 +117,7 @@ ret_t suggest_words_find(suggest_words_t* suggest_words, wchar_t c) { const uint8_t* data = NULL; return_value_if_fail(suggest_words != NULL && c != 0, RET_BAD_PARAMS); + suggest_words->words_nr = 0; data = suggest_words_find_data(suggest_words->res, c); return_value_if_fail(data != NULL, RET_FAIL);