Commit 957e8a7
fix: replace touch long press handling with TapHandler for better
reliability
Replaced the `onPressAndHold` event handler with a `TapHandler`
component for touchscreen long press interactions across multiple
QML files. This change prevents duplicate handling of touch events
by introducing a flag `isTouchLongPressed` that blocks the subsequent
`onClicked` execution. The old `onPressAndHold` approach was unreliable
and caused duplicated menu triggers.
Log: Improved touchscreen long press reliability by using TapHandler
Influence:
1. Test touchscreen long press on icon items to trigger context menu
2. Verify that short tap still properly triggers the default action
(e.g., launching app)
3. Ensure no duplicate menu popups occur during touch interaction
4. Test with mouse input to confirm no regression in right-click context
menu
5. Verify drag-and-drop behavior remains unaffected on touch devices
fix: 使用 TapHandler 替代触摸长按处理以提高可靠性
将多个 QML 文件中的 `onPressAndHold` 事件处理器替换为 `TapHandler` 组件
来处理触摸屏长按交互。此修改通过引入 `isTouchLongPressed` 标志位来阻止后
续的 `onClicked` 重复执行,解决了原有 `onPressAndHold` 方法不可靠导致的
菜单重复触发问题。
Log: 通过使用 TapHandler 提高触摸长按的可靠性
Influence:
1. 测试触摸屏长按图标项是否正常触发上下文菜单
2. 验证短触是否仍能正常触发默认操作(如启动应用)
3. 确保触摸交互期间不会出现重复的菜单弹窗
4. 测试鼠标输入,确认右键上下文菜单无回归问题
5. 验证触摸设备上的拖拽功能不受影响
PMS: BUG-3588271 parent b0c62f2 commit 957e8a7
4 files changed
Lines changed: 77 additions & 28 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
118 | 118 | | |
119 | 119 | | |
120 | 120 | | |
| 121 | + | |
| 122 | + | |
| 123 | + | |
| 124 | + | |
| 125 | + | |
| 126 | + | |
| 127 | + | |
| 128 | + | |
| 129 | + | |
| 130 | + | |
| 131 | + | |
| 132 | + | |
| 133 | + | |
121 | 134 | | |
| 135 | + | |
122 | 136 | | |
123 | 137 | | |
124 | 138 | | |
| |||
146 | 160 | | |
147 | 161 | | |
148 | 162 | | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
149 | 168 | | |
150 | 169 | | |
151 | 170 | | |
| |||
156 | 175 | | |
157 | 176 | | |
158 | 177 | | |
159 | | - | |
160 | | - | |
161 | | - | |
162 | | - | |
163 | | - | |
164 | | - | |
165 | 178 | | |
166 | 179 | | |
167 | 180 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
225 | 225 | | |
226 | 226 | | |
227 | 227 | | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
| 231 | + | |
| 232 | + | |
| 233 | + | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
228 | 240 | | |
| 241 | + | |
229 | 242 | | |
230 | 243 | | |
231 | 244 | | |
232 | 245 | | |
233 | 246 | | |
234 | 247 | | |
235 | 248 | | |
| 249 | + | |
| 250 | + | |
| 251 | + | |
| 252 | + | |
| 253 | + | |
236 | 254 | | |
237 | 255 | | |
238 | 256 | | |
239 | 257 | | |
240 | 258 | | |
241 | 259 | | |
242 | 260 | | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | 261 | | |
250 | 262 | | |
251 | 263 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
332 | 332 | | |
333 | 333 | | |
334 | 334 | | |
| 335 | + | |
| 336 | + | |
| 337 | + | |
| 338 | + | |
| 339 | + | |
| 340 | + | |
| 341 | + | |
| 342 | + | |
| 343 | + | |
| 344 | + | |
| 345 | + | |
| 346 | + | |
| 347 | + | |
| 348 | + | |
| 349 | + | |
335 | 350 | | |
| 351 | + | |
336 | 352 | | |
337 | 353 | | |
338 | 354 | | |
| |||
341 | 357 | | |
342 | 358 | | |
343 | 359 | | |
| 360 | + | |
| 361 | + | |
| 362 | + | |
| 363 | + | |
| 364 | + | |
344 | 365 | | |
345 | 366 | | |
346 | 367 | | |
| |||
350 | 371 | | |
351 | 372 | | |
352 | 373 | | |
353 | | - | |
354 | | - | |
355 | | - | |
356 | | - | |
357 | | - | |
358 | | - | |
359 | | - | |
360 | | - | |
361 | | - | |
362 | | - | |
363 | 374 | | |
364 | 375 | | |
365 | 376 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
52 | 52 | | |
53 | 53 | | |
54 | 54 | | |
| 55 | + | |
| 56 | + | |
| 57 | + | |
| 58 | + | |
| 59 | + | |
| 60 | + | |
| 61 | + | |
| 62 | + | |
| 63 | + | |
| 64 | + | |
| 65 | + | |
| 66 | + | |
| 67 | + | |
55 | 68 | | |
| 69 | + | |
56 | 70 | | |
57 | 71 | | |
58 | 72 | | |
59 | 73 | | |
60 | 74 | | |
61 | 75 | | |
62 | 76 | | |
| 77 | + | |
| 78 | + | |
| 79 | + | |
| 80 | + | |
| 81 | + | |
63 | 82 | | |
64 | 83 | | |
65 | 84 | | |
66 | 85 | | |
67 | | - | |
68 | | - | |
69 | | - | |
70 | | - | |
71 | | - | |
72 | | - | |
73 | 86 | | |
74 | 87 | | |
75 | 88 | | |
| |||
0 commit comments