1
0
Fork 0
flightgear/utils/fgqcanvas/qml/InputLine.qml

58 lines
1.2 KiB
QML
Raw Normal View History

import QtQuick 2.2
Item {
id: root
property alias text: input.text
property alias label: labelText.text
signal editingFinished
implicitHeight: 30
implicitWidth: 200
Text {
id: labelText
anchors.left: parent.left
anchors.right: inputFrame.left
anchors.verticalCenter: parent.verticalCenter
}
Rectangle {
id: inputFrame
border.width: 2
border.color: input.focus ? "orange" : "#9f9f9f"
color: "#3f3f3f"
width: parent.width * 0.5
anchors.right: parent.right
height: root.height
TextInput {
id: input
anchors {
left: parent.left
leftMargin: 8
right: parent.right
rightMargin: 8
verticalCenter: parent.verticalCenter
}
2018-11-06 17:58:44 +00:00
onActiveFocusChanged: {
if (activeFocus) {
selectAll();
}
}
verticalAlignment: Text.AlignVCenter
onEditingFinished: {
root.editingFinished();
}
color: "#9f9f9f"
}
}
}