[ui] AttributeEditor: improve display of long floating point values

This commit is contained in:
Fabien Castan 2020-02-28 10:32:05 +01:00
parent b85ff4d27f
commit 77fc562a1e

View file

@ -237,11 +237,21 @@ RowLayout {
selectByMouse: true
validator: attribute.type == "FloatParam" ? doubleValidator : intValidator
onEditingFinished: setTextFieldAttribute(text)
onAccepted: setTextFieldAttribute(text)
onAccepted: {
setTextFieldAttribute(text)
// When the text is too long, display the left part
// (with the most important values and cut the floating point details)
ensureVisible(0)
}
Component.onDestruction: {
if(activeFocus)
setTextFieldAttribute(text)
}
Component.onCompleted: {
// When the text is too long, display the left part
// (with the most important values and cut the floating point details)
ensureVisible(0)
}
}
Loader {