This repository has been archived on 2024-06-03. You can view files and clone it, but cannot push or open issues or pull requests.
app/qml/components/InputDelegate.qml
Dorian Zedler dc26169fe0 - many design improvements:
- new text inputs
 - new delegate highlighting
 - better text scaling
- some cleanup
2019-03-29 19:15:20 +01:00

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
}
}
}
}