Conversation
1. Root cause: all ToolTip attached properties relied on Qt default positioning (centered relative to parent item), without binding x/y to cursor position, causing tooltips to appear at fixed locations instead of following the mouse 2. Fix: add HoverHandler for cursor tracking where absent and bind ToolTip.toolTip.x/y to HoverHandler point.position in all 4 ToolTip usage sites 3. Impact: tooltips now appear at cursor position across fullscreen and windowed launcher modes; no change to tooltip text, visibility logic, or delay timing Log: Launcher tooltips now follow the mouse cursor instead of appearing at a fixed position Influence: 1. Test tooltip appears at cursor position in fullscreen mode 2. Test tooltip appears at cursor position in windowed mode 3. Verify tooltip still only shows when text is truncated 4. Verify tooltip delay and visibility logic unchanged fix: 启动器 tooltip 跟随光标位置显示 1. 根因:所有 ToolTip 附加属性依赖 Qt 默认定位逻辑(相对父项居中), 未绑定 x/y 到光标位置,导致 tooltip 固定出现在图标上方/下方而非跟随鼠标 2. 方案:为缺少 HoverHandler 的组件新增 HoverHandler 追踪光标,在全部 4 个 ToolTip 使用点绑定 ToolTip.toolTip.x/y 到 HoverHandler 的 point.position 3. 影响:全屏和窗口模式下 tooltip 均跟随光标位置显示;不改变 tooltip 文本、 显示/隐藏逻辑和延迟时间 Log: 启动器 tooltip 现在跟随鼠标光标位置显示,而非固定位置 Influence: 1. 测试全屏模式下 tooltip 跟随光标位置显示 2. 测试窗口模式下 tooltip 跟随光标位置显示 3. 验证 tooltip 仍仅在文字截断时显示 4. 验证 tooltip 延迟和显示/隐藏逻辑无变化 PMS: BUG-276573
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: mhduiy The full list of commands accepted by this bot can be found here. DetailsNeeds approval from an approver in each of these files:Approvers can indicate their approval by writing |
Reviewer's guide (collapsed on small PRs)Reviewer's GuideUpdates all four launcher tooltip sites to position the tooltip at the current cursor coordinates, adding HoverHandlers for icon delegates and reusing existing handlers in list views while preserving tooltip text, visibility conditions, and delay behavior. File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
deepin pr auto review🤖 AI 代码审查报告📊 总体评价
🔍 详细分析1. 语法逻辑 ✅评价: 优秀 ✅ 通过 潜在问题: 建议: [] 2. 代码质量 ✅评价: 优秀 ✅ 通过 潜在问题: 建议: [] 3. 代码性能 ✅评价: 优秀 ✅ 通过 潜在问题: 建议: [] 4. 代码安全 🔒评价: 优秀 ✅ 通过
安全漏洞详情: 建议: [] 💡 改进建议代码示例// 暂无代码示例本报告由 AI 代码审查工具自动生成 |
|
如果要改,要修改DTK的默认行为,而不是仅仅在这里修改,这个PR暂定 |
Root Cause Analysis
All 4 ToolTip usage sites in dde-launchpad relied on Qt's default ToolTip positioning (centered relative to the parent item), without binding
ToolTip.toolTip.x/ToolTip.toolTip.yto cursor position. This caused tooltips to appear at a fixed location (above or below the icon) rather than following the mouse cursor. Key evidence:qml/IconItemDelegate.qml:377-379andqml/windowed/AppListView.qml:220-222only set text/delay/visible with no position binding; developer note in PMS history confirmed "tooltip position is a fixed value, needs unified handling later."Fix
Added HoverHandler for cursor tracking in files that lacked one (
qml/IconItemDelegate.qml,qml/windowed/IconItemDelegate.qml), and boundToolTip.toolTip.x/ToolTip.toolTip.ytoHoverHandler.point.positionin all 4 ToolTip usage sites. Files with existing HoverHandler (qml/windowed/AppListView.qml,qml/windowed/FreeSortListView.qml) reuse the existingitemHoverHandler.Change Safety Assessment
Code Safety
Business Impact Scope
Affects tooltip display position in launcher fullscreen mode (icon grid) and windowed mode (icon grid, app list, free-sort list). Tooltip text content, show/hide logic, and delay timing remain unchanged. Users will see tooltips appear at the cursor position instead of a fixed location above/below the icon.
Verification Suggestion
Test tooltip cursor-following in both fullscreen and windowed launcher modes by hovering over icons with truncated text. Verify tooltips still only appear when text is truncated and that delay timing is unchanged.
根因分析
dde-launchpad 中全部 4 个 ToolTip 使用点均依赖 Qt 默认定位逻辑(相对父项居中),未绑定
ToolTip.toolTip.x/ToolTip.toolTip.y到光标位置,导致 tooltip 固定出现在图标上方或下方而非跟随鼠标。关键证据:qml/IconItemDelegate.qml:377-379和qml/windowed/AppListView.qml:220-222仅设置 text/delay/visible,无位置绑定;PMS 历史记录中开发者确认"tooltip 为固定值,需要后面统一处理此类型问题"。修复方案
为缺少 HoverHandler 的文件(
qml/IconItemDelegate.qml、qml/windowed/IconItemDelegate.qml)新增 HoverHandler 追踪光标位置,在全部 4 个 ToolTip 使用点绑定ToolTip.toolTip.x/ToolTip.toolTip.y到HoverHandler.point.position。已有 HoverHandler 的文件(qml/windowed/AppListView.qml、qml/windowed/FreeSortListView.qml)复用已有的itemHoverHandler。改动安全评估
代码安全评估
业务影响范围
影响启动器全屏模式(图标网格)和窗口模式(图标网格、应用列表、自由排序列表)的 tooltip 显示位置。Tooltip 文本内容、显示/隐藏逻辑和延迟时间不变。用户将看到 tooltip 出现在光标位置而非图标上方/下方的固定位置。
验证建议
在全屏和窗口模式下分别测试鼠标 hover 到文字截断图标时 tooltip 是否跟随光标位置显示。验证 tooltip 仍仅在文字截断时显示,延迟时间无变化。
Summary by Sourcery
Bug Fixes: