Skip to content

Commit dc14a60

Browse files
committed
fix: enable touch scrolling in launcher
1. Update the icon press handling in AppListView.qml and FreeSortListView.qml. 2. Detect synthesized mouse events generated from touch input by checking mouse.source. 3. When the event comes from touch rather than a real mouse, mark it as not accepted and return early so the parent Flickable can handle vertical scrolling. 4. Keep the existing left-click image grab and subsequent interaction logic unchanged for real mouse input. 5. This change is necessary because launcher icons were consuming touch-generated press events, which blocked swipe up/down gestures and prevented smooth scrolling in the app list. Log: Enabled vertical touch scrolling on launcher app icons Influence: 1. Verify that swiping up and down directly on launcher icons scrolls the app list smoothly. 2. Verify that mouse left-click behavior on icons is unchanged, including image grab related interactions. 3. Test long-press behavior on touch devices to ensure it does not regress unexpectedly. 4. Verify scrolling behavior in both AppListView and FreeSortListView. 5. Test with real mouse input and touch input separately to confirm correct event routing. 6. Check that icon click, drag, and reorder related interactions still work as expected after the event acceptance change. fix: 启动器支持图标区域触控滑动 1. 更新了 AppListView.qml 和 FreeSortListView.qml 中的图标按下事件处理 逻辑。 2. 通过检查 mouse.source 来识别由触摸输入合成的鼠标事件。 3. 当事件来源于触摸而不是真实鼠标时,将事件设置为不接受并提前返回,让父 级 Flickable 接管上下滑动处理。 4. 对真实鼠标输入,保留原有的左键截图抓取及后续交互逻辑不变。 5. 之所以需要此修改,是因为启动器图标此前会消费触摸生成的按下事件,导致 用户在图标区域上下滑动时手势被拦截,应用列表无法顺畅滚动。 Log: 已支持在启动器应用图标区域进行上下触控滑动 Influence: 1. 验证在启动器图标区域直接上下滑动时,应用列表能够平滑滚动。 2. 验证鼠标左键点击图标的行为保持不变,包括相关的图像抓取交互。 3. 在触屏设备上测试长按行为,确认没有引入异常回归。 4. 分别验证 AppListView 和 FreeSortListView 中的滚动表现。 5. 使用真实鼠标输入和触摸输入分别测试,确认事件分发符合预期。 6. 检查图标点击、拖拽、自由排序等相关交互在事件接受逻辑调整后仍然正常。 PMS: BUG-362161 Change-Id: I54e01447f677a2275ab285c576dabbf84799f5f5
1 parent e5e72a1 commit dc14a60

2 files changed

Lines changed: 10 additions & 1 deletion

File tree

qml/windowed/AppListView.qml

Lines changed: 5 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -238,6 +238,11 @@ FocusScope {
238238
}
239239

240240
onPressed: function (mouse) {
241+
// 触屏合成的鼠标事件不接受,交给 Flickable 处理滚动
242+
if (mouse.source !== undefined && mouse.source !== 0) {
243+
mouse.accepted = false
244+
return
245+
}
241246
isTouchLongPressed = false
242247
if (mouse.button === Qt.LeftButton) {
243248
itemDelegate.contentItem.grabToImage(function(result) {

qml/windowed/FreeSortListView.qml

Lines changed: 5 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -351,14 +351,18 @@ Item {
351351
}
352352

353353
onPressed: function (mouse) {
354+
// 触屏合成的鼠标事件不接受,交给 Flickable 处理滚动
355+
if (mouse.source !== undefined && mouse.source !== 0) {
356+
mouse.accepted = false
357+
return
358+
}
354359
isTouchLongPressed = false
355360
if (mouse.button === Qt.LeftButton) {
356361
itemDelegate.contentItem.grabToImage(function(result) {
357362
itemDelegate.Drag.imageSource = result.url
358363
})
359364
}
360365
}
361-
362366
onClicked: function (mouse) {
363367
if (isTouchLongPressed) {
364368
isTouchLongPressed = false

0 commit comments

Comments
 (0)