-
Notifications
You must be signed in to change notification settings - Fork 54
fix: show tray action icons during drag operations #1292
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
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
Reviewer's guide (collapsed on small PRs)Reviewer's GuideThis PR enhances drag-and-drop UX by toggling the tray action icons’ visibility during drag operations: it sets the "actionsAlwaysVisible" flag to true when a drag enters the tray area and resets it to false when the drag leaves without dropping, all within the TrayContainer component. Sequence diagram for tray action icons visibility during drag operationssequenceDiagram
actor User
participant "TrayContainer"
participant "TraySortOrderModel"
User->>"TrayContainer": Drag enters tray area
"TrayContainer"->>"TraySortOrderModel": Set actionsAlwaysVisible = true
User->>"TrayContainer": Drag leaves tray area (without drop)
"TrayContainer"->>"TraySortOrderModel": Set actionsAlwaysVisible = false
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
deepin pr auto review我来审查这段代码,并提供改进意见:
改进后的代码建议: Item {
// ... 其他代码保持不变 ...
// 拖拽进入处理
onDragEntered: {
surfaceId = dragEvent.getDataAsString("text/x-dde-shell-tray-dnd-surfaceId")
source = dragEvent.getDataAsString("text/x-dde-shell-tray-dnd-source")
// 验证拖拽数据的有效性
if (surfaceId && source) {
Qt.debug(`Drag entered - Surface ID: ${surfaceId}, Source: ${source}`)
// 显示动作图标
DDT.TraySortOrderModel.actionsAlwaysVisible = true
if (source !== "" && DDT.TraySortOrderModel.isDisplayedSurface(surfaceId)) {
dragEvent.accepted = false
} else {
dragEvent.accepted = true
dropTrayTimer.restart()
}
} else {
dragEvent.accepted = false
}
}
// 拖拽离开处理
onDragExited: {
dropTrayTimer.stop()
if (surfaceId) {
DDT.TraySortOrderModel.setSurfaceVisible(surfaceId, false)
}
// 隐藏动作图标
if (!isDropped) {
DDT.TraySortOrderModel.actionsAlwaysVisible = false
}
}
// ... 其他代码保持不变 ...
} 主要改进点:
这些改进可以提高代码的健壮性和可维护性,同时保持原有功能不变。 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: robertkill, wjyrich The full list of commands accepted by this bot can be found here.
Needs approval from an approver in each of these files:
Approvers can indicate their approval by writing |
/forcemerge |
This pr force merged! (status: blocked) |
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:
feat: 在拖拽操作期间显示托盘操作图标
添加了在拖拽操作期间使托盘操作图标(收起/显示隐藏)可见的逻辑。当拖拽事
件进入托盘容器时,操作图标变为可见以提供更好的视觉反馈。当拖拽离开而没有
放置时,操作图标再次隐藏以保持正常的UI状态。
Log: 托盘操作图标现在在拖拽操作期间出现在托盘上方
Influence:
PMS: BUG-336195
Summary by Sourcery
Bug Fixes: