mirror of
https://github.com/overte-org/overte.git
synced 2025-04-27 16:35:55 +02:00
35 lines
759 B
QML
35 lines
759 B
QML
import QtQuick 2.5
|
|
import QtQuick.Controls 1.4
|
|
|
|
Preference {
|
|
id: root
|
|
property real spacing: 8
|
|
height: labelText.height + dataTextField.height + spacing
|
|
|
|
Component.onCompleted: {
|
|
dataTextField.text = preference.value;
|
|
}
|
|
|
|
function save() {
|
|
preference.value = dataTextField.text;
|
|
preference.save();
|
|
}
|
|
|
|
Text {
|
|
id: labelText
|
|
color: enabled ? "black" : "gray"
|
|
text: root.label
|
|
}
|
|
|
|
TextField {
|
|
id: dataTextField
|
|
placeholderText: preference.placeholderText
|
|
anchors {
|
|
top: labelText.bottom
|
|
left: parent.left
|
|
right: parent.right
|
|
topMargin: root.spacing
|
|
rightMargin: root.spacing
|
|
}
|
|
}
|
|
}
|