fix(qml):【设计走查】功能排序工具提示显示位置不准确

This commit is contained in:
youdiansaodongxi 2023-12-05 09:22:08 +08:00
parent b6831d097d
commit 1170567ac1
3 changed files with 57 additions and 9 deletions

View File

@ -15,16 +15,32 @@ MouseArea {
border.width: 2
}
}
ToolTip {
property bool isVisible: controlBase.isTextTruncated && control.containsMouse
id: tip
x: mouseX + 15
y: mouseY + 15
text: name
visible: controlBase.isTextTruncated && control.containsMouse
delay: 500
}
onPositionChanged: {
if (tip.isVisible) {
if (tip.visible) {
tip.hide();
} else {
tip.show(name);
}
}
}
StyleBackground {
property bool isTextTruncated: content.textTruncated
id: controlBase
anchors.fill: parent
radius: 4
useStyleTransparent: false
paletteRole: Palette.Light
alpha: isSelect ? 1.00 : control.containsPress ? 0.82 : control.containsMouse ? 0.55 : 0.00
ToolTip.visible: content.textTruncated && control.containsMouse
ToolTip.text: name
ToolTip.delay: 500
RowLayout {
anchors.fill: parent

View File

@ -10,9 +10,26 @@ MouseArea {
property bool truncate: false
property bool isSelect: false
hoverEnabled: true
ToolTip.visible: !editStatus && truncate && control.containsMouse
ToolTip.text: name
ToolTip.delay: 500
ToolTip {
property bool isVisible: !editStatus && truncate && control.containsMouse
id: tip
x: mouseX + 15
y: mouseY + 15
text: name
visible: !editStatus && truncate && control.containsMouse
delay: 500
}
onPositionChanged: {
if (tip.isVisible) {
if (tip.visible) {
tip.hide();
} else {
tip.show(name);
}
}
}
states: State {
when: control.activeFocus
PropertyChanges {

View File

@ -6,9 +6,24 @@ import org.ukui.menu.core 1.0
MouseArea {
id: control
hoverEnabled: true
ToolTip.text: comment
ToolTip.visible: control.containsMouse
ToolTip.delay: 500
ToolTip {
property bool isVisible: control.containsMouse
id: tip
x: mouseX + 15
y: mouseY + 15
text: comment
visible: control.containsMouse
delay: 500
}
onPositionChanged: {
if (tip.isVisible) {
if (tip.visible) {
tip.hide();
} else {
tip.show(comment);
}
}
}
states: State {
when: control.activeFocus
PropertyChanges {