From 8df6686af9d5316ee03a8b408773a85075c3862a Mon Sep 17 00:00:00 2001 From: Wu JiangYu Date: Mon, 30 Nov 2026 09:59:10 +0800 Subject: [PATCH] refactor(launchpad): use shared tooltip timing MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 --- shell-launcher-applet/package/launcheritem.qml | 17 +++-------------- 1 file changed, 3 insertions(+), 14 deletions(-) diff --git a/shell-launcher-applet/package/launcheritem.qml b/shell-launcher-applet/package/launcheritem.qml index ce7eae26..fe9c0a58 100644 --- a/shell-launcher-applet/package/launcheritem.qml +++ b/shell-launcher-applet/package/launcheritem.qml @@ -486,15 +486,6 @@ AppletItem { onXChanged: updateLaunchpadPos() onYChanged: updateLaunchpadPos() } - Timer { - id: toolTipShowTimer - interval: 50 - 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() - } - } TapHandler { id: tapHandler @@ -518,12 +509,10 @@ AppletItem { HoverHandler { 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 { - if (toolTipShowTimer.running) { - toolTipShowTimer.stop() - } - toolTip.close() } }