Skip to content

Commit 5b5b7e9

Browse files
committed
fix: tray tooltip position incorrect for stashed area on treeland
修正 treeland 会话下,向上收起的托盘区域中的图标 tooltip 位置不正确. PMS: BUG-339313 Log:
1 parent 1fe247f commit 5b5b7e9

1 file changed

Lines changed: 9 additions & 13 deletions

File tree

panels/dock/tray/SurfacePopup.qml

Lines changed: 9 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
// SPDX-FileCopyrightText: 2024 UnionTech Software Technology Co., Ltd.
1+
// SPDX-FileCopyrightText: 2024 - 2026 UnionTech Software Technology Co., Ltd.
22
//
33
// SPDX-License-Identifier: GPL-3.0-or-later
44

@@ -17,16 +17,12 @@ Item {
1717
property int toolTipVOffset: 0
1818
signal popupCreated(var surfaceId)
1919

20-
PanelToolTipWindow {
21-
id: toolTipWindow
22-
onVisibleChanged: function (arg) {
23-
if (arg && menuWindow.visible)
24-
menuWindow.close()
25-
}
26-
}
2720
PanelToolTip {
2821
id: toolTip
29-
toolTipWindow: toolTipWindow
22+
onToolTipVisibleChanged: function (visible) {
23+
if (visible && menuWindow.visible)
24+
menuWindow.close()
25+
}
3026

3127
property alias shellSurface: surfaceLayer.shellSurface
3228
ShellSurfaceItemProxy {
@@ -48,8 +44,8 @@ Item {
4844
PanelMenuWindow {
4945
id: menuWindow
5046
onVisibleChanged: function (arg) {
51-
if (arg && toolTipWindow.visible)
52-
toolTipWindow.close()
47+
if (arg && toolTip.toolTipVisible)
48+
toolTip.close()
5349
}
5450
onUpdateGeometryFinished: function () {
5551
if (!menu.shellSurface)
@@ -128,10 +124,10 @@ Item {
128124

129125
toolTip.shellSurface = popupSurface
130126
toolTip.toolTipX = Qt.binding(function () {
131-
return toolTip.shellSurface.x - toolTip.width / 2
127+
return Panel.popupWindow.xOffset + toolTip.shellSurface.x - toolTip.width / 2
132128
})
133129
toolTip.toolTipY = Qt.binding(function () {
134-
return toolTip.shellSurface.y - toolTip.height - toolTipVOffset
130+
return Panel.popupWindow.yOffset + toolTip.shellSurface.y - toolTip.height - toolTipVOffset
135131
})
136132
toolTip.open()
137133
} else if (popupSurface.popupType === Dock.TrayPopupTypeMenu) {

0 commit comments

Comments
 (0)