editbox improvements
the build failed
Details
the build failed
Details
This commit is contained in:
parent
6671af4f2a
commit
59e7d26b25
|
@ -7,8 +7,8 @@ import QtQuick.Layouts 1.3
|
||||||
|
|
||||||
Item {
|
Item {
|
||||||
id: root
|
id: root
|
||||||
height: lbl.height
|
height: lbl.visible ? lbl.height : txt.height + (gcd.os == "linux" ? btn.height + 3 : 0) //lbl.height
|
||||||
implicitHeight: lbl.height
|
implicitHeight: height //lbl.height
|
||||||
|
|
||||||
property alias text: lbl.text
|
property alias text: lbl.text
|
||||||
signal updated
|
signal updated
|
||||||
|
@ -38,9 +38,9 @@ Item {
|
||||||
|
|
||||||
|
|
||||||
onClicked: {
|
onClicked: {
|
||||||
console.log("click")
|
|
||||||
lbl.visible = img.visible = false
|
lbl.visible = img.visible = false
|
||||||
txt.visible = true
|
txt.visible = true
|
||||||
|
if (gcd.os == "linux") btn.visible = true
|
||||||
txt.text = lbl.text
|
txt.text = lbl.text
|
||||||
txt.selectAll()
|
txt.selectAll()
|
||||||
txt.focus = true
|
txt.focus = true
|
||||||
|
@ -70,9 +70,21 @@ Item {
|
||||||
|
|
||||||
function save() {
|
function save() {
|
||||||
root.text = txt.text
|
root.text = txt.text
|
||||||
txt.visible = false
|
txt.visible = btn.visible = false
|
||||||
lbl.visible = img.visible = true
|
lbl.visible = img.visible = true
|
||||||
root.updated(txt.text)
|
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()
|
||||||
|
}
|
||||||
}
|
}
|
|
@ -105,7 +105,6 @@ ColumnLayout {
|
||||||
Layout.alignment: Qt.AlignHCenter
|
Layout.alignment: Qt.AlignHCenter
|
||||||
|
|
||||||
onUpdated: {
|
onUpdated: {
|
||||||
//nick = lblNick.text
|
|
||||||
gcd.updateNick(lblNick.text)
|
gcd.updateNick(lblNick.text)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
Reference in New Issue