O fundo de um campo de texto é invisível se este campo de texto for somente leitura. Para mim, eles são invisíveis tanto no telefone quanto na área de trabalho (15.04).
Arquivo de estilo de tema
/usr/lib/x86_64-linux-gnu/qt5/qml/Ubuntu/Components/Themes/Ambiance/TextAreaStyle.qml
(qtdeclarative5-ubuntu-ui-toolkit-plugin: amd64 1.2.1458 + 15.04.20150422-0ub) mostra que é intencional:
property Component background: UbuntuShape {
property bool error: (styledItem.hasOwnProperty("errorHighlight") && styledItem.errorHighlight && !styledItem.acceptableInput)
onErrorChanged: (error) ? visuals.errorColor : visuals.backgroundColor;
color: visuals.backgroundColor;
anchors.fill: parent
visible: !styledItem.readOnly
}
A solução ideal (que não funciona ainda porque não há Ubuntu.Components.Styles nesta versão) é sobrepor o estilo:
import QtQuick 2.4
import Ubuntu.Components 1.2
import Ubuntu.Components.Styles 1.2
TextField {
readOnly: true
style: TextFieldStyle {
background: UbuntuShape {
color: Theme.palette.normal.field
anchors.fill: parent
}
}
}
Por enquanto, só consigo pensar em um plano de fundo codificado como esse:
TextField {
readOnly: true
UbuntuShape {
z: -1
color: Theme.palette.normal.field
anchors.fill: parent
}
}