mirror of
https://github.com/Ultimaker/Cura.git
synced 2025-07-23 14:44:13 -06: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
1 changed files with 14 additions and 3 deletions
|
@ -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…
Add table
Add a link
Reference in a new issue