widget_set_need_relayout_children after changed visibility

This commit is contained in:
lixianjing 2019-07-04 15:57:57 +08:00
parent 7c23271e29
commit f430f73edf
2 changed files with 4 additions and 0 deletions

View File

@ -4,6 +4,7 @@
* 增加TK\_GLYPH\_CACHE\_NR宏允许开发者自行定义。
* 更新文档(感谢俊杰提供补丁)。
* 修改软件键盘删除键无效的问题。
* set visible后设置relayout标志。
* 2019/07/03
* 更新demoui

View File

@ -703,6 +703,7 @@ static ret_t widget_set_visible_self(widget_t* widget, bool_t visible) {
widget->visible = visible;
widget_update_style(widget);
widget_invalidate_force(widget, NULL);
widget_set_need_relayout_children(widget->parent);
}
return RET_OK;
@ -720,6 +721,8 @@ static ret_t widget_set_visible_recursive(widget_t* widget, bool_t visible) {
return_value_if_fail(widget != NULL, RET_BAD_PARAMS);
widget->visible = visible;
widget_set_need_relayout_children(widget->parent);
WIDGET_FOR_EACH_CHILD_BEGIN(widget, iter, i)
widget_set_visible_recursive(iter, visible);
WIDGET_FOR_EACH_CHILD_END()