Merge branch 'ebf201903201404' of cwtch.im/ui into master
This commit is contained in:
commit
a552fe885b
|
@ -49,13 +49,23 @@ ColumnLayout {
|
||||||
font.pixelSize: lbl.font.pixelSize
|
font.pixelSize: lbl.font.pixelSize
|
||||||
horizontalAlignment: Text.AlignHCenter
|
horizontalAlignment: Text.AlignHCenter
|
||||||
|
|
||||||
|
onActiveFocusChanged: {
|
||||||
|
if (!activeFocus) {
|
||||||
|
save()
|
||||||
|
}
|
||||||
|
}
|
||||||
|
|
||||||
Keys.onReturnPressed: {
|
Keys.onReturnPressed: {
|
||||||
if (event.modifiers == Qt.NoModifier) {
|
if (event.modifiers == Qt.NoModifier) {
|
||||||
root.text = txt.text
|
save()
|
||||||
txt.visible = false
|
|
||||||
lbl.visible = true
|
|
||||||
root.updated(txt.text)
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
function save() {
|
||||||
|
root.text = txt.text
|
||||||
|
txt.visible = false
|
||||||
|
lbl.visible = true
|
||||||
|
root.updated(txt.text)
|
||||||
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
Reference in New Issue