diff --git a/qml/widgets/InplaceEditText.qml b/qml/widgets/InplaceEditText.qml index 9ed92bab..5c945b85 100644 --- a/qml/widgets/InplaceEditText.qml +++ b/qml/widgets/InplaceEditText.qml @@ -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() + } } \ No newline at end of file diff --git a/qml/widgets/MyProfile.qml b/qml/widgets/MyProfile.qml index ff160cb2..78599a5a 100644 --- a/qml/widgets/MyProfile.qml +++ b/qml/widgets/MyProfile.qml @@ -105,7 +105,6 @@ ColumnLayout { Layout.alignment: Qt.AlignHCenter onUpdated: { - //nick = lblNick.text gcd.updateNick(lblNick.text) } }