improve dialog

This commit is contained in:
lixianjing 2022-04-18 17:59:34 +08:00
parent 1227647d95
commit c937c6a5c8
3 changed files with 9 additions and 2 deletions

View File

@ -4,6 +4,7 @@
* 完善ui\_loader\_load对xml的支持。
* 增加函数assets\_manager\_set\_fallback\_load\_asset
* awtk修复缺少连接ws2_32类库的问题 (感谢智明提供补丁)。
* 修复关闭对话框后马上打开对话框不正常的问题(感谢智明提供补丁)。
2022/04/17
* fscript增加函数widget\_add\_value

View File

@ -148,6 +148,7 @@ dialog_quit_code_t dialog_modal(widget_t* widget) {
log_debug("awtk web not support dialog_modal\n");
return DIALOG_QUIT_NONE;
#else
main_loop_t* l = main_loop();
dialog_t* dialog = DIALOG(widget);
return_value_if_fail(dialog != NULL, DIALOG_QUIT_NONE);
@ -156,7 +157,9 @@ dialog_quit_code_t dialog_modal(widget_t* widget) {
dialog->quited = FALSE;
dialog->is_model = TRUE;
widget_invalidate(widget, NULL);
main_loop_run(main_loop());
dialog->quit_num = l->quit_num;
l->quit_num = 0;
main_loop_run(l);
log_debug("%s quit\n", __FUNCTION__);
idle_add(dialog_idle_close, widget);
@ -185,13 +188,15 @@ ret_t dialog_quit(widget_t* widget, uint32_t code) {
log_debug("awtk web not support dialog_modal\n");
dialog_close(widget);
#else
main_loop_t* l = main_loop();
dialog_t* dialog = DIALOG(widget);
return_value_if_fail(dialog != NULL && !(dialog->quited), RET_BAD_PARAMS);
return_value_if_fail(is_dialog_opened(widget), RET_BAD_PARAMS);
dialog->quited = TRUE;
dialog->quit_code = (dialog_quit_code_t)code;
main_loop_quit(main_loop());
l->quit_num = dialog->quit_num;
main_loop_quit(l);
#endif /*AWTK_WEB*/
return RET_OK;

View File

@ -195,6 +195,7 @@ typedef struct _dialog_t {
dialog_quit_code_t quit_code;
bool_t quited;
bool_t is_model;
uint8_t quit_num;
} dialog_t;
/**