Display the tooltip over the text itself and only if it's truncated

This commit is contained in:
Cameron Gutman 2018-10-14 21:39:37 -07:00
parent 9166a604d6
commit ef99f02bc7

View File

@ -100,6 +100,12 @@ GridView {
horizontalAlignment: Text.AlignHCenter
wrapMode: Text.Wrap
elide: Text.ElideRight
// Display a tooltip with the full name if it's truncated
ToolTip.text: model.name
ToolTip.delay: 1000
ToolTip.timeout: 5000
ToolTip.visible: parent.hovered && truncated
}
function launchOrResumeSelectedApp()
@ -133,16 +139,6 @@ GridView {
}
}
ToolTip {
// We don't use the shared tooltip because then the tooltip
// would follow the mouse cursor while visible rather than
// resetting to invisible as it should
text: model.name
delay: 1000
timeout: 5000
visible: parent.hovered
}
Keys.onMenuPressed: {
// We must use open() here so the menu is positioned on
// the ItemDelegate and not where the mouse cursor is