mirror of
https://github.com/overte-org/overte.git
synced 2025-08-09 03:17:02 +02:00
reimplement 'text input with pencil' based on QQC2 TextField
This commit is contained in:
parent
00b54c3f46
commit
4bb517f620
1 changed files with 34 additions and 1 deletions
|
@ -97,15 +97,48 @@ Rectangle {
|
||||||
text: 'Display Name'
|
text: 'Display Name'
|
||||||
}
|
}
|
||||||
|
|
||||||
InputTextStyle4 {
|
TextField {
|
||||||
|
id: displayNameInput
|
||||||
anchors.left: displayNameLabel.right
|
anchors.left: displayNameLabel.right
|
||||||
anchors.leftMargin: 30
|
anchors.leftMargin: 30
|
||||||
anchors.verticalCenter: displayNameLabel.verticalCenter
|
anchors.verticalCenter: displayNameLabel.verticalCenter
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.rightMargin: 36
|
anchors.rightMargin: 36
|
||||||
width: 232
|
width: 232
|
||||||
|
|
||||||
|
property bool error: text === '';
|
||||||
text: 'ThisIsDisplayName'
|
text: 'ThisIsDisplayName'
|
||||||
|
|
||||||
|
states: [
|
||||||
|
State {
|
||||||
|
name: "hovered"
|
||||||
|
when: displayNameInput.hovered && !displayNameInput.focus && !displayNameInput.error;
|
||||||
|
PropertyChanges { target: displayNameInputBackground; color: '#afafaf' }
|
||||||
|
},
|
||||||
|
State {
|
||||||
|
name: "focused"
|
||||||
|
when: displayNameInput.focus && !displayNameInput.error
|
||||||
|
PropertyChanges { target: displayNameInputBackground; color: '#f2f2f2' }
|
||||||
|
PropertyChanges { target: displayNameInputBackground; border.color: '#00b4ef' }
|
||||||
|
},
|
||||||
|
State {
|
||||||
|
name: "error"
|
||||||
|
when: displayNameInput.error
|
||||||
|
PropertyChanges { target: displayNameInputBackground; color: '#f2f2f2' }
|
||||||
|
PropertyChanges { target: displayNameInputBackground; border.color: '#e84e62' }
|
||||||
|
}
|
||||||
|
]
|
||||||
|
|
||||||
|
background: Rectangle {
|
||||||
|
id: displayNameInputBackground
|
||||||
|
implicitWidth: 200
|
||||||
|
implicitHeight: 40
|
||||||
|
color: '#d4d4d4'
|
||||||
|
border.color: '#afafaf'
|
||||||
|
border.width: 1
|
||||||
|
radius: 2
|
||||||
|
}
|
||||||
|
|
||||||
HiFiGlyphs {
|
HiFiGlyphs {
|
||||||
anchors.right: parent.right
|
anchors.right: parent.right
|
||||||
anchors.verticalCenter: parent.verticalCenter
|
anchors.verticalCenter: parent.verticalCenter
|
||||||
|
|
Loading…
Reference in a new issue