Commit 2aea012
committed
refactor: replace DragHandler with MouseArea for app dragging
1. Replaced DragHandler with MouseArea for better drag control and
simpler implementation
2. Changed drag state detection from dragHandler.active to drag.active
3. Simplified drag initialization by directly setting Drag.active from
mouseArea
4. Removed complex state management and replaced with direct property
binding
5. Combined left/right click handling in single MouseArea for cleaner
code
6. Improved drag image handling by showing/hiding background during
drag operation
7. Fixed potential crash issues by eliminating the need for external
dndItem
refactor: 使用 MouseArea 替换 DragHandler 处理应用拖拽
1. 使用 MouseArea 替换 DragHandler 以获得更好的拖拽控制和更简单的实现
2. 将拖拽状态检测从 dragHandler.active 改为 drag.active
3. 通过直接从 mouseArea 设置 Drag.active 简化了拖拽初始化
4. 移除了复杂的状态管理,改用直接属性绑定
5. 在单个 MouseArea 中合并左右键点击处理,代码更清晰
6. 改进了拖拽图像处理,在拖拽操作期间显示/隐藏背景
7. 通过消除对外部 dndItem 的需求修复了潜在的崩溃问题1 parent d3f17a6 commit 2aea012
1 file changed
Lines changed: 29 additions & 53 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
165 | 165 | | |
166 | 166 | | |
167 | 167 | | |
168 | | - | |
| 168 | + | |
169 | 169 | | |
170 | 170 | | |
171 | 171 | | |
| |||
206 | 206 | | |
207 | 207 | | |
208 | 208 | | |
| 209 | + | |
209 | 210 | | |
210 | 211 | | |
211 | 212 | | |
212 | 213 | | |
213 | | - | |
214 | | - | |
215 | | - | |
216 | | - | |
217 | | - | |
218 | | - | |
219 | | - | |
220 | | - | |
221 | | - | |
222 | | - | |
223 | | - | |
224 | | - | |
225 | | - | |
226 | | - | |
227 | | - | |
228 | | - | |
229 | | - | |
230 | | - | |
231 | | - | |
232 | | - | |
233 | | - | |
234 | | - | |
235 | | - | |
236 | | - | |
237 | | - | |
| 214 | + | |
| 215 | + | |
| 216 | + | |
| 217 | + | |
| 218 | + | |
| 219 | + | |
238 | 220 | | |
239 | 221 | | |
240 | | - | |
241 | | - | |
242 | | - | |
243 | | - | |
244 | | - | |
245 | | - | |
246 | | - | |
247 | | - | |
248 | | - | |
249 | | - | |
250 | | - | |
251 | | - | |
252 | | - | |
| 222 | + | |
| 223 | + | |
| 224 | + | |
| 225 | + | |
| 226 | + | |
| 227 | + | |
| 228 | + | |
| 229 | + | |
| 230 | + | |
253 | 231 | | |
254 | 232 | | |
255 | 233 | | |
256 | | - | |
257 | | - | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
| 234 | + | |
| 235 | + | |
| 236 | + | |
| 237 | + | |
| 238 | + | |
| 239 | + | |
| 240 | + | |
265 | 241 | | |
266 | 242 | | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
| 243 | + | |
| 244 | + | |
| 245 | + | |
| 246 | + | |
| 247 | + | |
272 | 248 | | |
273 | 249 | | |
274 | 250 | | |
| |||
0 commit comments