mirror of
https://git.mirrors.martin98.com/https://github.com/Ultimaker/Cura
synced 2025-08-13 04:29:01 +08:00
Show tooltip if text got elided
This way you can still see the whole text, even if the cell is too small. Handy. Contributes to issue CURA-8686.
This commit is contained in:
parent
f22fea5f22
commit
e607ae7b92
@ -132,14 +132,25 @@ Item
|
|||||||
font: UM.Theme.getFont("default")
|
font: UM.Theme.getFont("default")
|
||||||
color: UM.Theme.getColor("text")
|
color: UM.Theme.getColor("text")
|
||||||
}
|
}
|
||||||
MouseArea
|
TextMetrics
|
||||||
|
{
|
||||||
|
id: cellTextMetrics
|
||||||
|
text: cellContent.text
|
||||||
|
font: cellContent.font
|
||||||
|
elide: cellContent.elide
|
||||||
|
elideWidth: cellContent.width
|
||||||
|
}
|
||||||
|
UM.TooltipArea
|
||||||
{
|
{
|
||||||
anchors.fill: parent
|
anchors.fill: parent
|
||||||
|
|
||||||
enabled: tableBase.allowSelection
|
text: (cellTextMetrics.elidedText == cellContent.text) ? "" : cellContent.text //Show full text in tooltip if it was elided.
|
||||||
onClicked:
|
onClicked:
|
||||||
{
|
{
|
||||||
tableBase.currentRow = row; //Select this row.
|
if(tableBase.allowSelection)
|
||||||
|
{
|
||||||
|
tableBase.currentRow = row; //Select this row.
|
||||||
|
}
|
||||||
}
|
}
|
||||||
onDoubleClicked:
|
onDoubleClicked:
|
||||||
{
|
{
|
||||||
|
Loading…
x
Reference in New Issue
Block a user