mirror of
https://gitee.com/zlgopen/awtk.git
synced 2024-11-30 02:58:26 +08:00
improve candidates
This commit is contained in:
parent
f15413188d
commit
1e67642f3e
@ -1,5 +1,8 @@
|
||||
# 最新动态
|
||||
|
||||
* 2020/08/07
|
||||
* 候选字控件 (candidate) 支持设置 margin style。
|
||||
|
||||
* 2020/08/06
|
||||
* 完善离线 lcd(感谢智明提供补丁)。
|
||||
* 完善 slist (感谢智明提供补丁)。
|
||||
|
@ -138,12 +138,13 @@ static ret_t candidates_relayout_children(widget_t* widget) {
|
||||
style_t* style = children[0]->astyle;
|
||||
canvas_t* c = widget_get_canvas(widget);
|
||||
const char* font = system_info_fix_font_name(NULL);
|
||||
int32_t child_margin = style_get_int(style, STYLE_ID_MARGIN, 0);
|
||||
uint16_t font_size = style_get_int(style, STYLE_ID_FONT_SIZE, TK_DEFAULT_FONT_SIZE);
|
||||
|
||||
canvas_set_font(c, font, font_size);
|
||||
for (i = 0; i < nr; i++) {
|
||||
iter = children[i];
|
||||
child_w = candidates_calc_child_width(c, iter);
|
||||
child_w = candidates_calc_child_width(c, iter) + child_margin* 2;
|
||||
if (iter->text.size) {
|
||||
widget_set_visible(iter, TRUE, FALSE);
|
||||
} else {
|
||||
|
Loading…
Reference in New Issue
Block a user