fix(qml/AppUI): 修改issue I9SG56: 部分位置悬浮不显示缩略内容

This commit is contained in:
youdiansaodongxi 2024-07-11 15:17:36 +08:00
parent 6be045f9b4
commit 4c9314c63a
2 changed files with 18 additions and 0 deletions

View File

@ -43,6 +43,13 @@ GridView {
focus: true focus: true
hoverEnabled: true hoverEnabled: true
UkuiItems.Tooltip {
anchors.fill: parent
mainText: modelData.label
posFollowCursor: true
active: labelArea.showTooltip
}
onClicked: { onClicked: {
GridView.view.labelSelected(modelData.label); GridView.view.labelSelected(modelData.label);
GridView.view.currentIndex = model.index GridView.view.currentIndex = model.index
@ -55,6 +62,9 @@ GridView {
} }
UkuiItems.StyleBackground { UkuiItems.StyleBackground {
id: labelArea
property bool showTooltip: labelText.visible ? labelText.truncated : false
anchors.fill: parent anchors.fill: parent
radius: Platform.Theme.normalRadius radius: Platform.Theme.normalRadius
@ -66,6 +76,7 @@ GridView {
borderColor: Platform.Theme.Highlight borderColor: Platform.Theme.Highlight
UkuiItems.StyleText { UkuiItems.StyleText {
id: labelText
anchors.fill: parent anchors.fill: parent
visible: modelData.type === LabelItem.Text visible: modelData.type === LabelItem.Text
text: modelData.display text: modelData.display

View File

@ -33,6 +33,13 @@ MouseArea {
hoverEnabled: true hoverEnabled: true
UkuiItems.Tooltip {
anchors.fill: parent
mainText: text.text
posFollowCursor: true
active: text.truncated
}
UkuiItems.StyleBackground { UkuiItems.StyleBackground {
id: styleBackground id: styleBackground
anchors.fill: parent anchors.fill: parent