58 lines
1.2 KiB
QML
58 lines
1.2 KiB
QML
|
import QtQuick 2.0
|
||
|
import QtQuick.Controls 2.3
|
||
|
|
||
|
SmoothItemDelegate {
|
||
|
id: control
|
||
|
|
||
|
property string inputText: ""
|
||
|
|
||
|
onInputTextChanged: {
|
||
|
textField.text = inputText
|
||
|
}
|
||
|
|
||
|
text: qsTr("delay (ms)")
|
||
|
|
||
|
width: parent.width
|
||
|
height: parent.delegateHeight
|
||
|
|
||
|
TextField {
|
||
|
id: textField
|
||
|
|
||
|
anchors.right: parent.right
|
||
|
anchors.verticalCenter: parent.verticalCenter
|
||
|
|
||
|
width: parent.width * 0.3
|
||
|
height: parent.height
|
||
|
|
||
|
focus: true
|
||
|
placeholderText: qsTr("time")
|
||
|
|
||
|
font.pixelSize: height * 0.4
|
||
|
|
||
|
opacity: control.enabled ? 1:0.2
|
||
|
|
||
|
inputMethodHints: Qt.ImhFormattedNumbersOnly
|
||
|
|
||
|
palette.text: appTheme.style.textColor
|
||
|
|
||
|
onTextChanged: {
|
||
|
control.inputText = text
|
||
|
control.inputTextChanged()
|
||
|
}
|
||
|
|
||
|
background: Rectangle {
|
||
|
implicitWidth: 200
|
||
|
implicitHeight: 40
|
||
|
color: "transparent"//control.enabled ? "transparent" : "#353637"
|
||
|
border.color: (textField.activeFocus ? "#21be2b" : "#999999")
|
||
|
radius: height * 0.3
|
||
|
}
|
||
|
|
||
|
Behavior on opacity {
|
||
|
NumberAnimation {
|
||
|
duration: 200
|
||
|
}
|
||
|
}
|
||
|
}
|
||
|
}
|