editbox improvements
the build failed Details

This commit is contained in:
erinn 2019-09-20 14:19:48 -07:00
parent 6671af4f2a
commit 59e7d26b25
2 changed files with 16 additions and 5 deletions

View File

@ -7,8 +7,8 @@ import QtQuick.Layouts 1.3
Item {
id: root
height: lbl.height
implicitHeight: lbl.height
height: lbl.visible ? lbl.height : txt.height + (gcd.os == "linux" ? btn.height + 3 : 0) //lbl.height
implicitHeight: height //lbl.height
property alias text: lbl.text
signal updated
@ -38,9 +38,9 @@ Item {
onClicked: {
console.log("click")
lbl.visible = img.visible = false
txt.visible = true
if (gcd.os == "linux") btn.visible = true
txt.text = lbl.text
txt.selectAll()
txt.focus = true
@ -70,9 +70,21 @@ Item {
function save() {
root.text = txt.text
txt.visible = false
txt.visible = btn.visible = false
lbl.visible = img.visible = true
root.updated(txt.text)
}
}
SimpleButton {
id: btn
anchors.top: txt.bottom
anchors.topMargin: 3
anchors.horizontalCenter: parent.horizontalCenter
visible: false
text: "Update"
onClicked: txt.save()
}
}

View File

@ -105,7 +105,6 @@ ColumnLayout {
Layout.alignment: Qt.AlignHCenter
onUpdated: {
//nick = lblNick.text
gcd.updateNick(lblNick.text)
}
}