Repository navigation
refactor(launchpad): use shared tooltip timing - #866
Conversation
1. Remove the launcher icon's local show timer. 2. Delegate hover timing and cancellation to PanelToolTip. Log: Use the shared tooltip delay for the launcher icon. Influence: Launcher and Dock tooltip delays match. refactor(launchpad): 复用任务栏提示计时 1. 移除启动器图标自己的显示计时器。 2. 将悬停计时和取消交给 PanelToolTip。 Log: 启动器图标使用任务栏的公共提示延时。 Influence: 启动器与任务栏的提示延时一致。 PMS: TASK-399397
Reviewer's GuideUIRemove the launcher icon’s local tooltip timer and open or close the tooltip directly on hover, relying on PanelToolTip for shared delay and cancellation.
Tips and commandsInteracting with Sourcery
Customizing Your ExperienceAccess your dashboard to:
Getting Help
|
There was a problem hiding this comment.
Hey - I've found 3 issues
Prompt for AI Agents
Please address the comments from this code review:
## Individual Comments
### Comment 1
<location path="shell-launcher-applet/package/launcheritem.qml" line_range="512-513" />
<code_context>
onHoveredChanged: {
if (hovered) {
- toolTipShowTimer.start()
+ const point = launcher.mapToItem(null, launcher.width / 2, launcher.height / 2)
+ toolTip.DockPanelPositioner.bounding = Qt.rect(point.x, point.y, toolTip.width, toolTip.height)
+ toolTip.open()
} else {
</code_context>
<issue_to_address>
**Tooltip appears at old position**
When the dock or launcher moves or resizes during the shared tooltip delay, `DockPanelPositioner.bounding` retains the coordinates assigned on hover entry while `toolTip.open()` waits for the shared delay, so the tooltip appears detached from the launcher.
Update `DockPanelPositioner.bounding` after the delay using the launcher’s current position and size.
</issue_to_address>
### Comment 2
<location path="shell-launcher-applet/package/launcheritem.qml" line_range="514" />
<code_context>
- onTriggered: {
- var point = Applet.rootObject.mapToItem(null, Applet.rootObject.width / 2, Applet.rootObject.height / 2)
- toolTip.DockPanelPositioner.bounding = Qt.rect(point.x, point.y, toolTip.width, toolTip.height)
- toolTip.open()
- }
- }
</code_context>
<issue_to_address>
**Right-click leaves tooltip open**
When the pointer remains over the icon and the user right-clicks before the shared tooltip delay expires, `TapHandler.onTapped` accepts right-button taps but only calls `toggleLauncher()` for the left button, so it does not close or cancel the pending tooltip and the tooltip appears after the delay.
Handle right-button taps by closing the tooltip and cancelling its pending display.
Also at `shell-launcher-applet/package/launcheritem.qml:515`.
</issue_to_address>
### Comment 3
<location path="shell-launcher-applet/package/launcheritem.qml" line_range="514" />
<code_context>
- onTriggered: {
- var point = Applet.rootObject.mapToItem(null, Applet.rootObject.width / 2, Applet.rootObject.height / 2)
- toolTip.DockPanelPositioner.bounding = Qt.rect(point.x, point.y, toolTip.width, toolTip.height)
- toolTip.open()
- }
- }
</code_context>
<issue_to_address>
**Older shell loses tooltip delay**
When the launcher is deployed with a dde-shell build that satisfies the current dependency but predates the shared timing change, `toolTip.open()` relies on the shared delay added by the companion dde-shell change. With an older dde-shell build, the removed local timer is no longer there and the tooltip opens immediately instead of using the common delay.
Require the first dde-shell version containing the shared tooltip timing change, or preserve a local fallback for older versions.
</issue_to_address>| const point = launcher.mapToItem(null, launcher.width / 2, launcher.height / 2) | ||
| toolTip.DockPanelPositioner.bounding = Qt.rect(point.x, point.y, toolTip.width, toolTip.height) |
There was a problem hiding this comment.
🟡 Medium · Tooltip appears at old position
When the dock or launcher moves or resizes during the shared tooltip delay, DockPanelPositioner.bounding retains the coordinates assigned on hover entry while toolTip.open() waits for the shared delay, so the tooltip appears detached from the launcher.
Update DockPanelPositioner.bounding after the delay using the launcher’s current position and size.
Prompt for AI agents
In `shell-launcher-applet/package/launcheritem.qml` at lines 512-513:
**Tooltip appears at old position**
When the dock or launcher moves or resizes during the shared tooltip delay, `DockPanelPositioner.bounding` retains the coordinates assigned on hover entry while `toolTip.open()` waits for the shared delay, so the tooltip appears detached from the launcher.
Update `DockPanelPositioner.bounding` after the delay using the launcher’s current position and size.| toolTipShowTimer.start() | ||
| const point = launcher.mapToItem(null, launcher.width / 2, launcher.height / 2) | ||
| toolTip.DockPanelPositioner.bounding = Qt.rect(point.x, point.y, toolTip.width, toolTip.height) | ||
| toolTip.open() |
There was a problem hiding this comment.
🟡 Medium · Right-click leaves tooltip open
When the pointer remains over the icon and the user right-clicks before the shared tooltip delay expires, TapHandler.onTapped accepts right-button taps but only calls toggleLauncher() for the left button, so it does not close or cancel the pending tooltip and the tooltip appears after the delay.
Handle right-button taps by closing the tooltip and cancelling its pending display.
Also at shell-launcher-applet/package/launcheritem.qml:515.
Prompt for AI agents
In `shell-launcher-applet/package/launcheritem.qml` at line 514:
**Right-click leaves tooltip open**
When the pointer remains over the icon and the user right-clicks before the shared tooltip delay expires, `TapHandler.onTapped` accepts right-button taps but only calls `toggleLauncher()` for the left button, so it does not close or cancel the pending tooltip and the tooltip appears after the delay.
Handle right-button taps by closing the tooltip and cancelling its pending display.
Also at `shell-launcher-applet/package/launcheritem.qml:515`.| toolTipShowTimer.start() | ||
| const point = launcher.mapToItem(null, launcher.width / 2, launcher.height / 2) | ||
| toolTip.DockPanelPositioner.bounding = Qt.rect(point.x, point.y, toolTip.width, toolTip.height) | ||
| toolTip.open() |
There was a problem hiding this comment.
🟡 Medium · Older shell loses tooltip delay
When the launcher is deployed with a dde-shell build that satisfies the current dependency but predates the shared timing change, toolTip.open() relies on the shared delay added by the companion dde-shell change. With an older dde-shell build, the removed local timer is no longer there and the tooltip opens immediately instead of using the common delay.
Require the first dde-shell version containing the shared tooltip timing change, or preserve a local fallback for older versions.
Prompt for AI agents
In `shell-launcher-applet/package/launcheritem.qml` at line 514:
**Older shell loses tooltip delay**
When the launcher is deployed with a dde-shell build that satisfies the current dependency but predates the shared timing change, `toolTip.open()` relies on the shared delay added by the companion dde-shell change. With an older dde-shell build, the removed local timer is no longer there and the tooltip opens immediately instead of using the common delay.
Require the first dde-shell version containing the shared tooltip timing change, or preserve a local fallback for older versions.|
[APPROVALNOTIFIER] This PR is NOT APPROVED This pull-request has been approved by: 18202781743, 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 |
移除启动器图标自己的 50 毫秒提示计时器。悬停时由 PanelToolTip 按公共的 300 毫秒延时显示,指针离开或点击图标时取消待显示提示。
对应的 dde-shell PR:https://github.com/linuxdeepin/dde-shell/pull/1899。请先合入该 PR。
验证:启动器 QML 检查通过。
Summary by Sourcery
Enhancements:
PMS: TASK-399397