Skip to content

Commit 5ed035e

Browse files
committed
fix: adjust AlertToolTip position and animations
1. Added y-position calculation to position tooltip below target element with proper spacing 2. Removed opacity animations temporarily due to transparency causing tooltips to appear through window background 3. Maintained vertical slide animations for enter/exit transitions 4. The opacity animations are commented with TODO for future fix when transparency issue is resolved fix: 调整 AlertToolTip 位置和动画效果 1. 添加 y 位置计算,使工具提示在目标元素下方以适当间距定位 2. 暂时移除透明度动画,因为透明度会导致工具提示透过窗口背景显示 3. 保留垂直滑动动画用于进入/退出过渡 4. 透明度动画已添加 TODO 注释,待透明度问题解决后修复 pms: BUG-334771
1 parent 75676b9 commit 5ed035e

1 file changed

Lines changed: 4 additions & 2 deletions

File tree

qt6/src/qml/AlertToolTip.qml

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@ ToolTip {
1111
property Item target
1212

1313
x: 0
14+
y: target ? target.height + DS.Style.control.spacing : 0
1415
topPadding: DS.Style.alertToolTip.verticalPadding
1516
bottomPadding: DS.Style.alertToolTip.verticalPadding
1617
leftPadding: DS.Style.alertToolTip.horizontalPadding
@@ -40,12 +41,13 @@ ToolTip {
4041
}
4142

4243
enter: Transition {
43-
NumberAnimation { properties: "opacity"; from: 0.0; to: 1.0; duration: 200 }
44+
// TODO: Transparency causes tooltips to appear through the window background - temporarily removed
45+
// NumberAnimation { properties: "opacity"; from: 0.0; to: 1.0; duration: 200 }
4446
NumberAnimation { properties: "y"; from: control.target.height; to: control.target.height + DS.Style.control.spacing; duration: 200 }
4547
}
4648

4749
exit: Transition {
48-
NumberAnimation { properties: "opacity"; from: 1.0; to: 0.0 }
50+
// NumberAnimation { properties: "opacity"; from: 1.0; to: 0.0 }
4951
NumberAnimation { properties: "y"; from: control.target.height + DS.Style.control.spacing ; to: control.target.height }
5052
}
5153
}

0 commit comments

Comments
 (0)