Silica TextField text is aligned too low
As mentioned in this feature request the Silica TextField doesn't have a property verticalAlignment
, and no matter how many hoops you jump through, there are no ways to make it align properly without it. Hence a bug report instead.
As can be seen below, it aligns way off the baseline of a label, even though the labels use AlignBottom
:
Label {
id: fromSymbolLabel;
text: fromSymbol;
verticalAlignment: Text.AlignBottom
horizontalAlignment: Text.AlignRight
}
TextField {
horizontalAlignment: TextInput.AlignHCenter
// The hoops:
//_editor.verticalAlignment: TextInput.AlignTop
//on_EditorChanged: _editor.verticalAlignment = TextInput.AlignTop
// Component.onCompleted: _editor.verticalAlignment = TextInput.AlignTop
}
Label {
text: ' = ' + toSymbol + ' ' + qsTr("%L1").arg(result);
horizontalAlignment: Text.AlignHCenter;
verticalAlignment: Text.AlignBottom;
}
Edit: Added Labels for comparizon
Purely guess work on my behalf, could it be
Qt.Align
rather thanText.Align
and rather thanAlignBottom
how aboutQt.AlignVCenter
? (https://doc.qt.io/qt-5/qml-qtquick-layouts-layout.html#details)Also,
Spam Hunter ( 2019-09-07 15:16:06 +0200 )editimport QtQuick.Layout 1.0
(contained within Sailfish). For more info, navigate to/usr/lib/qt5/qml/QtQuick/Layouts/plugins.qmltypes
Not according to the docs:
I'm not quite sure what to do with
plugins.qmltypes
?As for layout elements in the same Row or Flow should be aligned equally vertically, if I read the docs right.
Adding
Tanghus ( 2019-09-08 03:39:40 +0200 )edittopPadding: Theme.paddingSmall
to the labels helps a but, but not really the way to go.'plugins.qml types' just tells you what is available to use within that module, it was nothing other than a hint for extra info.
Spam Hunter ( 2019-09-08 12:41:55 +0200 )editWhere you thinking of
Tanghus ( 2019-09-08 12:43:36 +0200 )editRowLayout
instead ofRow
?Ah, ok. Guess we sat down at the computer at the same time ;)
Tanghus ( 2019-09-08 12:44:30 +0200 )edit