From 5a57086c58688da96ff89d3f710bc90ba1ed9e1d Mon Sep 17 00:00:00 2001 From: lixianjing Date: Sat, 5 Jun 2021 17:21:55 +0800 Subject: [PATCH] improve switch --- docs/changes.md | 3 +++ src/ext_widgets/switch/switch.c | 1 + 2 files changed, 4 insertions(+) diff --git a/docs/changes.md b/docs/changes.md index 07565be4f..6bee9f805 100644 --- a/docs/changes.md +++ b/docs/changes.md @@ -1,5 +1,8 @@ # 最新动态 +2021/06/05 + * 完善switch控件。修复滑动太快,pointer down和pointer up之间没有move事件的问题。 + 2021/06/04 * scroll bar mobile支持auto\_hide属性。 * 完善 scroll bar mobile 支持圆角。 diff --git a/src/ext_widgets/switch/switch.c b/src/ext_widgets/switch/switch.c index ecb8e2cbb..3531bd5da 100644 --- a/src/ext_widgets/switch/switch.c +++ b/src/ext_widgets/switch/switch.c @@ -150,6 +150,7 @@ static ret_t switch_on_event(widget_t* widget, event_t* e) { case EVT_POINTER_UP: { aswitch->pressed = FALSE; if (!aswitch->point_down_aborted) { + switch_on_pointer_move(aswitch, (pointer_event_t*)e); switch_on_pointer_up(aswitch, (pointer_event_t*)e); widget_ungrab(widget->parent, widget); } else {