mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-04-24 06:39:38 +08:00
Reuse the Cura ToolTip while showing long object item
It will only show the tooltip when the text is longer than the elided text. Contributes to CURA-6666.
This commit is contained in:
parent
fd452e74b3
commit
b9ed619c9a
@ -51,21 +51,20 @@ Button
|
||||
border.color: objectItemButton.checked ? UM.Theme.getColor("primary") : "transparent"
|
||||
}
|
||||
|
||||
ToolTip
|
||||
TextMetrics
|
||||
{
|
||||
visible: hovered
|
||||
delay: 1000
|
||||
id: buttonTextMetrics
|
||||
text: buttonText.text
|
||||
font: buttonText.font
|
||||
elide: buttonText.elide
|
||||
elideWidth: buttonText.width
|
||||
}
|
||||
|
||||
contentItem: Text
|
||||
Cura.ToolTip
|
||||
{
|
||||
text: objectItemButton.text
|
||||
font: UM.Theme.getFont("default")
|
||||
color: UM.Theme.getColor("tooltip_text")
|
||||
}
|
||||
background: Rectangle
|
||||
{
|
||||
color: UM.Theme.getColor("tooltip")
|
||||
}
|
||||
id: tooltip
|
||||
tooltipText: objectItemButton.text
|
||||
visible: objectItemButton.hovered && buttonTextMetrics.elidedText != buttonText.text
|
||||
}
|
||||
|
||||
onClicked: Cura.SceneController.changeSelection(index)
|
||||
|
Loading…
x
Reference in New Issue
Block a user