Repository navigation
Conversation
1. Add containsMouse and cursorPosition Q_PROPERTY bindings to DockPanel 2. Implement eventFilter logic to track Enter, MouseMove, Leave and Hide events on the dock window without per-item handlers 3. Cache spotlight tracking state via syncSpotlightTracking to avoid settings queries on the hot event path 4. Create DockSpotlight.qml component rendering a two-layer radial gradient spotlight following the cursor 5. Add SpotlightGradient.png texture asset shared by both layers 6. Wire the spotlight into main.qml with a Loader gated on fashion mode and dock visibility 7. Add mouse event derived includes (QEnterEvent, QMouseEvent) and position clamping to keep the spotlight inside the window bounds Log: Added a cursor-following spotlight effect on the dock in fashion mode Influence: 1. Verify the spotlight appears when moving the cursor over the dock in fashion mode 2. Verify the spotlight disappears when the dock is hidden or when the cursor leaves the dock area 3. Test theme switching between light and dark mode to confirm spotlight opacity values change correctly 4. Verify the spotlight does not appear in non-fashion (efficient) mode 5. Test with dock resizing and different dock positions/screen edges 6. Verify the spotlight tracks the cursor smoothly when a control keeps its mouse grab after the pointer leaves the window 7. Confirm no regression in existing dock click, drag and context menu interactions feat: 添加任务栏聚光灯光标跟踪 1. 在 DockPanel 中新增 containsMouse 和 cursorPosition 属性绑定 2. 在 eventFilter 中处理 Enter、MouseMove、Leave 和 Hide 事件, 无需逐项事件处理器即可跟踪光标 3. 通过 syncSpotlightTracking 缓存聚光灯跟踪状态,避免在热路径上 查询设置 4. 新建 DockSpotlight.qml 组件,渲染跟随光标的两层径向渐变聚光灯 5. 添加 SpotlightGradient.png 贴图供两层图像共享 6. 在 main.qml 中通过 Loader 接入聚光灯,并根据时尚模式和任务栏 可见性进行条件加载 7. 添加 QEnterEvent、QMouseEvent 头文件,并对坐标进行边界钳制, 确保聚光灯始终位于窗口范围内 Log: 新增时尚模式下任务栏跟随光标的聚光灯效果 Influence: 1. 验证在时尚模式下将光标移动到任务栏上时聚光灯正常显示 2. 验证任务栏隐藏或光标移出任务栏区域时聚光灯消失 3. 测试浅色与深色主题切换,确认聚光灯透明度随之变化 4. 验证在非时尚(高效)模式下聚光灯不显示 5. 测试任务栏尺寸调整及不同位置/屏幕边缘的情况 6. 验证当控件在指针离开窗口后仍保持鼠标抓取时聚光灯仍能平滑跟踪 7. 确认现有任务栏点击、拖拽和右键菜单交互无回归问题 PMS: task-396639
|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: wjyrich 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 GuideThe PR implements a fashion-mode dock spotlight by caching cursor tracking in DockPanel’s window event filter, exposing the state to QML, rendering a shared-texture two-layer gradient, and conditionally loading it based on dock visibility and theme. Sequence diagram for dock spotlight cursor trackingsequenceDiagram
participant Window as DockWindow
participant Panel as DockPanel
participant QML as DockSpotlight
Note over Panel: syncSpotlightTracking caches fashionMode and hideState
Window->>Panel: Enter(position)
Panel->>Panel: setCursorPosition(position)
Panel->>Panel: setContainsMouse(true)
Panel-->>QML: cursorPositionChanged, containsMouseChanged
QML->>QML: Move two gradient layers to cursor
Window->>Panel: MouseMove(position)
Panel->>Panel: setCursorPosition(position)
Panel->>Panel: setContainsMouse(window bounds contains position)
Panel-->>QML: cursorPositionChanged, containsMouseChanged
Window->>Panel: Leave or Hide
Panel->>Panel: setContainsMouse(false)
Panel-->>QML: containsMouseChanged
QML->>QML: Fade spotlight opacity
File-Level Changes
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 2 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="panels/dock/package/DockSpotlight.qml" line_range="37" />
<code_context>
+ height: spotlight.baseRadius * 2.6
+ x: -width / 2
+ y: -height / 2
+ source: "SpotlightGradient.png"
+ fillMode: Image.Stretch
+ smooth: true
</code_context>
<issue_to_address>
**Spotlight effect is invisible**
When the installed dock package lacks `SpotlightGradient.png`, both `Image` elements in `DockSpotlight.qml` request the missing file, so Qt Quick cannot load the gradients and the spotlight renders without them. Users see no spotlight effect.
Include `SpotlightGradient.png` in the installed dock package or point both images to an available asset.
Also at `panels/dock/package/DockSpotlight.qml:49`.
</issue_to_address>
### Comment 2
<location path="panels/dock/dockpanel.cpp" line_range="591-592" />
<code_context>
+{
+ // Cache the mode so the hot event path never needs to query settings.
+ m_spotlightTracking = fashionMode() && hideState() == Show;
+ if (!m_spotlightTracking)
+ setContainsMouse(false);
+}
+
</code_context>
<issue_to_address>
**Spotlight stays hidden after activation**
When fashion mode becomes active while the pointer is already over the dock and remains stationary, `syncSpotlightTracking()` enables event tracking without sampling the pointer or updating `m_containsMouse`. With no subsequent mouse event, `containsMouse` stays false and the spotlight remains hidden until the pointer moves.
When enabling tracking, sample the current pointer and update `m_containsMouse`.
</issue_to_address>
deepin pr auto review★ 总体评分:97分 (大于70分通过)■ 【总体评价】
■ 【详细分析】
■ 【改进建议代码示例】 // 在 DockPanel::init() 末尾添加显式调用
bool DockPanel::init()
{
// ... existing init code ...
DPanel::init();
// 确保聚光灯跟踪初始状态正确
syncSpotlightTracking();
// ... rest of init code ...
return true;
} |
|
TAG Bot New tag: 2.0.58 |
|
TAG Bot New tag: 2.0.59 |
Log: Added a cursor-following spotlight effect on the dock in fashion mode
Influence:
feat: 添加任务栏聚光灯光标跟踪
Log: 新增时尚模式下任务栏跟随光标的聚光灯效果
Influence:
PMS: task-396639
Summary by Sourcery
Add a fashion-mode dock spotlight that follows the cursor and automatically respects dock visibility and theme settings.
New Features:
Enhancements:
Chores: