improve pages

This commit is contained in:
lixianjing 2022-07-13 07:02:09 +08:00
parent 710ccee5bc
commit 3ca7dc2957
2 changed files with 11 additions and 0 deletions

View File

@ -1,5 +1,9 @@
# 最新动态
2022/07/13
* 重构 widget\_add\_child
* 完善 pages 动态增加子控件。
2022/07/12
* 对话框高亮增加参数update\_background(感谢雨欣提供补丁)
* 完善 auto\_adjust\_size 为true时layout的处理(感谢智明提供补丁)

View File

@ -227,6 +227,12 @@ static ret_t pages_on_destroy(widget_t* widget) {
return RET_OK;
}
static ret_t pages_on_add_child(widget_t* widget, widget_t* child) {
widget_add_child_default(widget, child);
pages_show_active(widget);
return RET_OK;
}
static ret_t pages_on_remove_child(widget_t* widget, widget_t* child) {
pages_t* pages = PAGES(widget);
return_value_if_fail(widget != NULL && pages != NULL && child != NULL, RET_BAD_PARAMS);
@ -260,6 +266,7 @@ TK_DECL_VTABLE(pages) = {.size = sizeof(pages_t),
.on_event = pages_on_event,
.get_prop = pages_get_prop,
.set_prop = pages_set_prop,
.on_add_child = pages_on_add_child,
.on_remove_child = pages_on_remove_child,
.on_destroy = pages_on_destroy};