From f31d85f8b291bee46b2fe8e6d0bf907b65f613bc Mon Sep 17 00:00:00 2001 From: Robertkill Date: Fri, 10 Oct 2025 11:29:08 +0800 Subject: [PATCH] fix: show tray action icons during drag operations MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Added logic to make tray action icons (collapse/show stash) visible during drag operations over the tray area. When a drag event enters the tray container, the action icons become visible to provide better visual feedback. When the drag leaves without dropping, the action icons are hidden again to maintain normal UI state. Log: Tray action icons now appear during drag operations over the tray Influence: 1. Test dragging items over the system tray area 2. Verify action icons become visible when dragging over tray 3. Confirm action icons hide when drag leaves without dropping 4. Check that normal tray functionality remains unchanged 5. Test with various drag sources and file types feat: 在拖拽操作期间显示托盘操作图标 添加了在拖拽操作期间使托盘操作图标(收起/显示隐藏)可见的逻辑。当拖拽事 件进入托盘容器时,操作图标变为可见以提供更好的视觉反馈。当拖拽离开而没有 放置时,操作图标再次隐藏以保持正常的UI状态。 Log: 托盘操作图标现在在拖拽操作期间出现在托盘上方 Influence: 1. 测试在系统托盘区域上方拖拽项目 2. 验证拖拽到托盘上方时操作图标是否可见 3. 确认拖拽离开而没有放置时操作图标是否隐藏 4. 检查正常托盘功能是否保持不变 5. 使用各种拖拽源和文件类型进行测试 PMS: BUG-336195 --- panels/dock/tray/package/TrayContainer.qml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/panels/dock/tray/package/TrayContainer.qml b/panels/dock/tray/package/TrayContainer.qml index 12c8ca971..1c4e57e72 100644 --- a/panels/dock/tray/package/TrayContainer.qml +++ b/panels/dock/tray/package/TrayContainer.qml @@ -152,6 +152,8 @@ Item { surfaceId = dragEvent.getDataAsString("text/x-dde-shell-tray-dnd-surfaceId") source = dragEvent.getDataAsString("text/x-dde-shell-tray-dnd-source") console.log(surfaceId, source) + // Make action icons (collapse/show stash) visible while dragging over tray + DDT.TraySortOrderModel.actionsAlwaysVisible = true if (source !== "" && DDT.TraySortOrderModel.isDisplayedSurface(surfaceId)) { dragEvent.accepted = false } else { @@ -220,6 +222,10 @@ Item { dropTrayTimer.stop() DDT.TraySortOrderModel.setSurfaceVisible(surfaceId, false) } + // Hide action icons when drag leaves tray without dropping + if (!isDropped) { + DDT.TraySortOrderModel.actionsAlwaysVisible = false + } } Timer {