overte-JulianGro/interface/resources/qml/controls/TextInput.qml
2015-04-23 14:23:13 -07:00

34 lines
780 B
QML

import QtQuick 2.3
import QtQuick.Controls 1.2
TextInput {
SystemPalette { id: myPalette; colorGroup: SystemPalette.Active }
property string helperText
font.family: "Helvetica"
font.pointSize: 18
width: 256
height: 64
color: myPalette.text
clip: true
verticalAlignment: TextInput.AlignVCenter
onTextChanged: {
if (text == "") {
helperText.visible = true;
} else {
helperText.visible = false;
}
}
Text {
id: helperText
anchors.fill: parent
font.pointSize: parent.font.pointSize
font.family: parent.font.family
verticalAlignment: TextInput.AlignVCenter
text: parent.helperText
color: myPalette.dark
clip: true
}
}