From 0303a68a83ce5e8a65a72019303e63c21e1aebf5 Mon Sep 17 00:00:00 2001 From: yeshanshan Date: Fri, 6 Mar 2026 16:15:04 +0800 Subject: [PATCH 1/2] fix: correct mouse event handling area for icon items MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit The MouseArea was incorrectly placed inside the icon's contentItem, causing mouse events to only be captured within the icon image area rather than the entire delegate item. This led to poor user experience where drag-and-drop and click operations only worked when clicking directly on the icon image, not the surrounding area. Moved the MouseArea from inside the icon's contentItem to be a direct child of the Control's background. This ensures the MouseArea covers the entire delegate area, making drag-and-drop and click operations work consistently across the whole item surface. Log: Fixed issue where drag-and-drop and click operations only worked when clicking directly on app icons Influence: 1. Test drag-and-drop functionality by clicking and dragging from any area within app icon items 2. Verify click operations work consistently across entire icon item surface 3. Test both normal clicks and drag operations to ensure they don't interfere 4. Verify hover states and visual feedback work correctly 5. Test with various icon sizes and delegate configurations fix: 修复图标项鼠标事件处理区域错误 MouseArea 原本错误地放置在图标 contentItem 内部,导致鼠标事件只能在图标 图像区域内被捕获,而不是在整个委托项区域内。这导致了糟糕的用户体验,拖放 和点击操作只有在直接点击图标图像时才有效,而不是在周围区域。 将 MouseArea 从图标的 contentItem 内部移动到 Control 背景的直接子元素。 这确保了 MouseArea 覆盖整个委托区域,使拖放和点击操作在整个项目表面上都 能一致工作。 Log: 修复了拖放和点击操作仅在直接点击应用图标时才有效的问题 Influence: 1. 通过从应用图标项的任何区域点击和拖动来测试拖放功能 2. 验证点击操作在整个图标项表面上都能一致工作 3. 测试正常点击和拖动操作,确保它们不会相互干扰 4. 验证悬停状态和视觉反馈正常工作 5. 使用各种图标大小和委托配置进行测试 --- qml/windowed/IconItemDelegate.qml | 41 +++++++++++++++---------------- 1 file changed, 20 insertions(+), 21 deletions(-) diff --git a/qml/windowed/IconItemDelegate.qml b/qml/windowed/IconItemDelegate.qml index 11d848f5..6559cdc7 100644 --- a/qml/windowed/IconItemDelegate.qml +++ b/qml/windowed/IconItemDelegate.qml @@ -45,6 +45,26 @@ Control { ColorSelector.pressed: false ColorSelector.family: Palette.CrystalColor flat: true + MouseArea { + id: mouseArea + anchors.fill: parent + hoverEnabled: false + acceptedButtons: Qt.LeftButton + enabled: root.dndEnabled + drag.target: root + onPressed: function (mouse) { + if (mouse.button === Qt.LeftButton && root.dndEnabled) { + appIcon.grabToImage(function(result) { + root.Drag.imageSource = result.url; + }) + } + } + onClicked: { + if (!drag.active) { + root.itemClicked() + } + } + } contentItem: Column { anchors.fill: parent @@ -73,27 +93,6 @@ Control { palette: DTK.makeIconPalette(root.palette) theme: ApplicationHelper.DarkType } - - MouseArea { - id: mouseArea - anchors.fill: parent - hoverEnabled: false - acceptedButtons: Qt.LeftButton - enabled: root.dndEnabled - drag.target: root - onPressed: function (mouse) { - if (mouse.button === Qt.LeftButton && root.dndEnabled) { - appIcon.grabToImage(function(result) { - root.Drag.imageSource = result.url; - }) - } - } - onClicked: { - if (!drag.active) { - root.itemClicked() - } - } - } } // as topMargin From d4ef0036895b70a6e77bfe1bde22768aad5637d5 Mon Sep 17 00:00:00 2001 From: yeshanshan Date: Fri, 6 Mar 2026 16:16:24 +0800 Subject: [PATCH 2/2] chore: bump version to 2.0.30 update changelog to 2.0.30 --- debian/changelog | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/debian/changelog b/debian/changelog index f86aaf50..de47ccfe 100644 --- a/debian/changelog +++ b/debian/changelog @@ -1,3 +1,9 @@ +dde-launchpad (2.0.30) unstable; urgency=medium + + * fix: correct mouse event handling area for icon items + + -- YeShanShan Fri, 06 Mar 2026 16:16:24 +0800 + dde-launchpad (2.0.29) unstable; urgency=medium * fix: fix font weight property assignment