From 1c812cc7bf598e77e656fd9b3b61f65b69c5392f Mon Sep 17 00:00:00 2001 From: zhangkun2 Date: Mon, 14 Sep 2026 12:46:20 +0800 Subject: [PATCH] fix: enable page-turn drag in full app folder rows MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 1. Root cause: DelegateDropArea on app icons occluded folderPageDropArea drag events, preventing page-turn detection when a row was full of apps 2. Fix: DelegateDropArea maps drag position to folderPageDropArea coordinates and triggers page-turn in the edge zone (30 percent width), otherwise delegates to normal sort logic 3. Impact: page-turn drag works consistently regardless of row fullness, no change to sort behavior or page-turn zone size Log: Fix page-turn drag not working when app folder rows are full Influence: 1. Test dragging apps to page-turn zone with full rows 2. Test dragging apps to page-turn zone with partial rows 3. Test drag-to-sort and drag-out-to-close still work normally fix: 修复满排时应用文件夹弹窗翻页拖拽失效 1. 根因:应用图标 DelegateDropArea 在事件层级上遮挡了 folderPageDropArea,满排时拖拽事件无法传递到翻页检测区域 2. 方案:DelegateDropArea 将拖拽位置映射到 folderPageDropArea 坐标系,在翻页区域内触发翻页,否则正常进行重排序 3. 影响:满排与不满排时翻页行为一致,排序和翻页区域大小不变 Log: 修复应用文件夹满排时翻页拖拽失效问题 Influence: 1. 测试满排时拖拽应用到边缘翻页区域 2. 测试不满排时拖拽应用到边缘翻页区域 3. 验证拖拽排序和拖拽出文件夹关闭弹窗无回归 PMS: BUG-375231 --- qml/FolderGridViewPopup.qml | 28 ++++++++++++++++++++++++---- 1 file changed, 24 insertions(+), 4 deletions(-) diff --git a/qml/FolderGridViewPopup.qml b/qml/FolderGridViewPopup.qml index f021e485..eb1bc83e 100644 --- a/qml/FolderGridViewPopup.qml +++ b/qml/FolderGridViewPopup.qml @@ -192,6 +192,7 @@ Popup { readonly property int horizontalPadding: contentRoot.width * paddingColumns anchors.fill: parent property bool createdEmptyPage: false + property real lastDragX: 0 onEntered: root.onDragEnter(this) @@ -201,10 +202,14 @@ Popup { createdEmptyPage = false } - function checkDragMove() { - if (drag.x < horizontalPadding) { + function checkDragMove(dragX) { + if (dragX === undefined) { + dragX = drag.x + } + lastDragX = dragX + if (dragX < horizontalPadding) { pageIntent = -1 - } else if (drag.x > (width - horizontalPadding)) { + } else if (dragX > (width - horizontalPadding)) { let isLastPage = folderPagesView.currentIndex === folderPagesView.count - 1 if (isLastPage && folderPageDropArea.createdEmptyPage) { return @@ -254,7 +259,7 @@ Popup { } parent.pageIntent = 0 if (folderPagesView.currentIndex !== 0) { - parent.checkDragMove() + parent.checkDragMove(parent.lastDragX) } } } @@ -570,6 +575,13 @@ Popup { if (dragId !== model.desktopId) { isDragHover = true } + let mappedX = mapToItem(folderPageDropArea, drag.x, 0).x + if (mappedX < folderPageDropArea.horizontalPadding || mappedX > (folderPageDropArea.width - folderPageDropArea.horizontalPadding)) { + folderDragApplyTimer.stop() + folderPageDropArea.checkDragMove(mappedX) + return + } + folderPageDropArea.pageIntent = 0 folderDragApplyTimer.dragId = dragId folderDragApplyTimer.restart() } @@ -578,6 +590,13 @@ Popup { if (dragId === model.desktopId) { return } + let mappedX = mapToItem(folderPageDropArea, drag.x, 0).x + if (mappedX < folderPageDropArea.horizontalPadding || mappedX > (folderPageDropArea.width - folderPageDropArea.horizontalPadding)) { + folderDragApplyTimer.stop() + folderPageDropArea.checkDragMove(mappedX) + return + } + folderPageDropArea.pageIntent = 0 folderDragApplyTimer.dragId = dragId folderDragApplyTimer.currentDropX = drag.x if (!folderDragApplyTimer.running) { @@ -589,6 +608,7 @@ Popup { root.onDragExit(this) folderDragApplyTimer.stop() folderDragApplyTimer.dragId = "" + folderPageDropArea.pageIntent = 0 } Component.onDestruction: { root.onDragExit(this)