forked from qt-creator/qt-creator
QmlDesigner: Add tooltip on elided pills
Change-Id: I4a40070b958a46e46009ba8f141fd5c286858ab7 Reviewed-by: Brook Cronin <brook.cronin@qt.io> Reviewed-by: Thomas Hartmann <thomas.hartmann@qt.io> Reviewed-by: Qt CI Patch Build Bot <ci_patchbuild_bot@qt.io>
This commit is contained in:
committed by
Henning Gründl
parent
37c4937d6d
commit
da92e16a92
@@ -4,6 +4,7 @@
|
||||
import QtQuick
|
||||
import StudioControls as StudioControls
|
||||
import StudioTheme as StudioTheme
|
||||
import HelperWidgets as HelperWidgets
|
||||
|
||||
FocusScope {
|
||||
id: root
|
||||
@@ -54,12 +55,25 @@ FocusScope {
|
||||
root.remove()
|
||||
}
|
||||
|
||||
MouseArea {
|
||||
HelperWidgets.ToolTipArea {
|
||||
id: rootMouseArea
|
||||
anchors.fill: parent
|
||||
hoverEnabled: true
|
||||
cursorShape: root.isEditable() ? Qt.IBeamCursor : Qt.ArrowCursor
|
||||
onClicked: root.forceActiveFocus()
|
||||
tooltip: {
|
||||
if (textItem.visible) {
|
||||
if (textItem.truncated)
|
||||
return textItem.text
|
||||
else
|
||||
return ""
|
||||
}
|
||||
|
||||
if (textMetrics.width > textInput.width)
|
||||
return textInput.text
|
||||
|
||||
return ""
|
||||
}
|
||||
}
|
||||
|
||||
Rectangle {
|
||||
|
Reference in New Issue
Block a user