mirror of
https://github.com/lubosz/overte.git
synced 2025-04-09 12:12:30 +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'
|
||||
}
|
||||
|
||||
InputTextStyle4 {
|
||||
TextField {
|
||||
id: displayNameInput
|
||||
anchors.left: displayNameLabel.right
|
||||
anchors.leftMargin: 30
|
||||
anchors.verticalCenter: displayNameLabel.verticalCenter
|
||||
anchors.right: parent.right
|
||||
anchors.rightMargin: 36
|
||||
width: 232
|
||||
|
||||
property bool error: text === '';
|
||||
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 {
|
||||
anchors.right: parent.right
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
|
|
Loading…
Reference in a new issue