Skip to content

refactor(launchpad): use shared tooltip timing - #866

Merged
wjyrich merged 1 commit into
linuxdeepin:masterfrom
wjyrich:fix/task-399397-tooltip-master
Nov 30, 2026
Merged

wjyrich merged 1 commit into
linuxdeepin:masterfrom
wjyrich:fix/task-399397-tooltip-master

Conversation

@wjyrich

@wjyrich wjyrich commented Nov 30, 2026 •

Copy link
Copy Markdown
Contributor

移除启动器图标自己的 50 毫秒提示计时器。悬停时由 PanelToolTip 按公共的 300 毫秒延时显示,指针离开或点击图标时取消待显示提示。

对应的 dde-shell PR:https://github.com/linuxdeepin/dde-shell/pull/1899。请先合入该 PR。

验证:启动器 QML 检查通过。

Summary by Sourcery

Enhancements:

  • Use the shared PanelToolTip timing for launcher icon tooltips by removing the launcher's custom show timer and preserving tooltip cancellation when the pointer leaves or the icon is clicked.

PMS: TASK-399397

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
@sourcery-ai

sourcery-ai Bot commented Nov 30, 2026

Copy link
Copy Markdown

Reviewer's Guide

UI

Remove the launcher icon’s local tooltip timer and open or close the tooltip directly on hover, relying on PanelToolTip for shared delay and cancellation.

  • shell-launcher-applet/package/launcheritem.qml L489 (removed lines), L512-514, L516 (removed lines)

Tips and commands

Interacting with Sourcery

  • Trigger a new review: Comment @sourcery-ai review on the pull request.
  • Continue discussions: Reply directly to Sourcery's review comments.
  • Generate a GitHub issue from a review comment: Ask Sourcery to create an
    issue from a review comment by replying to it. You can also reply to a
    review comment with @sourcery-ai issue to create an issue from it.
  • Generate a pull request title: Write @sourcery-ai anywhere in the pull
    request title to generate a title at any time. You can also comment
    @sourcery-ai title on the pull request to (re-)generate the title at any time.
  • Generate a pull request summary: Write @sourcery-ai summary anywhere in
    the pull request body to generate a PR summary at any time exactly where you
    want it. You can also comment @sourcery-ai summary on the pull request to
    (re-)generate the summary at any time.
  • Generate reviewer's guide: Comment @sourcery-ai guide on the pull
    request to (re-)generate the reviewer's guide at any time.
  • Resolve all Sourcery comments: Comment @sourcery-ai resolve on the
    pull request to resolve all Sourcery comments. Useful if you've already
    addressed all the comments and don't want to see them anymore.
  • Dismiss all Sourcery reviews: Comment @sourcery-ai dismiss on the pull
    request to dismiss all existing Sourcery reviews. Especially useful if you
    want to start fresh with a new review - don't forget to comment
    @sourcery-ai review to trigger a new review!

Customizing Your Experience

Access your dashboard to:

  • Enable or disable review features such as the Sourcery-generated pull request
    summary, the reviewer's guide, and others.
  • Change the review language.
  • Add, remove or edit custom review instructions.
  • Adjust other review settings.

Getting Help

@sourcery-ai sourcery-ai Bot left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

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>

Sourcery is free for open source - if you like our reviews please consider sharing them ✨

Comment on lines +512 to +513
const point = launcher.mapToItem(null, launcher.width / 2, launcher.height / 2)
toolTip.DockPanelPositioner.bounding = Qt.rect(point.x, point.y, toolTip.width, toolTip.height)

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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()

Copy link
Copy Markdown

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

🟡 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.

@deepin-ci-robot

Copy link
Copy Markdown

[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.

Details Needs approval from an approver in each of these files:

Approvers can indicate their approval by writing /approve in a comment
Approvers can cancel approval by writing /approve cancel in a comment

@wjyrich
wjyrich merged commit 5447c58 into linuxdeepin:master Nov 30, 2026
13 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants