From 32ab14a65cf8691c85e7f3c8be2f95fa2f6a3c9f Mon Sep 17 00:00:00 2001 From: lixianjing Date: Fri, 30 Sep 2022 12:08:28 +0800 Subject: [PATCH] improve slide view --- docs/changes.md | 1 + src/ext_widgets/slide_view/slide_view.c | 7 ++++--- 2 files changed, 5 insertions(+), 3 deletions(-) diff --git a/docs/changes.md b/docs/changes.md index 010619404..c4e112ee1 100644 --- a/docs/changes.md +++ b/docs/changes.md @@ -5,6 +5,7 @@ * 修复digit_clock在destroy的时候找不到窗口导致警告的问(感谢智明提供补丁) * 修复popup弹窗不见的问题(感谢智明提供补丁) * 修复sizeof 的警告问题(感谢智明提供补丁) + * 修复非focused时候设置slide_view激活子控件的逻辑(感谢智明提供补丁) 2022/09/29 * 支持设置自定义键值(感谢兆坤提供补丁) diff --git a/src/ext_widgets/slide_view/slide_view.c b/src/ext_widgets/slide_view/slide_view.c index c4ec2898b..f1437d166 100644 --- a/src/ext_widgets/slide_view/slide_view.c +++ b/src/ext_widgets/slide_view/slide_view.c @@ -798,9 +798,10 @@ static ret_t slide_view_on_idle_init_save_target(const idle_info_t* idle) { slide_view_t* slide_view = NULL; return_value_if_fail(idle != NULL, RET_BAD_PARAMS); slide_view = SLIDE_VIEW(idle->ctx); - - slide_view_restore_target(WIDGET(slide_view)); - slide_view->init_idle_id = TK_INVALID_ID; + if (slide_view->widget.focused) { + slide_view_restore_target(WIDGET(slide_view)); + slide_view->init_idle_id = TK_INVALID_ID; + } return RET_OK; }