From e7ac242f6fc24f60199f8e7c1f7d568685e3195f Mon Sep 17 00:00:00 2001 From: Patryk Osmaczko Date: Fri, 8 Jul 2022 16:06:09 +0200 Subject: [PATCH] chore(dialogs): adapt RenameGroupPopup iterates: status-im/StatusQ#760 --- .../Chat/popups/RenameGroupPopup.qml | 50 +++++++------------ 1 file changed, 18 insertions(+), 32 deletions(-) diff --git a/ui/app/AppLayouts/Chat/popups/RenameGroupPopup.qml b/ui/app/AppLayouts/Chat/popups/RenameGroupPopup.qml index 7d31e1ea3e..f0c92d5804 100644 --- a/ui/app/AppLayouts/Chat/popups/RenameGroupPopup.qml +++ b/ui/app/AppLayouts/Chat/popups/RenameGroupPopup.qml @@ -6,46 +6,32 @@ import utils 1.0 import shared.controls 1.0 import StatusQ.Controls 0.1 -import StatusQ.Popups 0.1 +import StatusQ.Popups.Dialog 0.1 -StatusModal { - - id: popup - height: 210 - anchors.centerIn: parent - - header.title: qsTr("Group name") +StatusDialog { + id: root property string activeChannelName signal doRename(string groupName) + width: 400 + title: qsTr("Group name") + standardButtons: Dialog.Save + onOpened: { groupName.forceActiveFocus(Qt.MouseFocusReason) - groupName.text = popup.activeChannelName; + groupName.text = root.activeChannelName } - contentItem: Item { - width: popup.width - implicitHeight: childrenRect.height - Input { - id: groupName - anchors.left: parent.left - anchors.leftMargin: Style.current.padding - anchors.right: parent.right - anchors.rightMargin: Style.current.padding - anchors.top: parent.top - anchors.topMargin: Style.current.padding - placeholderText: qsTr("Group name") - Keys.onEnterPressed: doRename(groupName.text) - Keys.onReturnPressed: doRename(groupName.text) - } - } + onAccepted: root.doRename(groupName.text) - rightButtons: [ - StatusButton { - id: saveBtn - text: qsTr("Save") - onClicked : { doRename(groupName.text) } - } - ] + Input { + id: groupName + + anchors.fill: parent + + placeholderText: qsTr("Group name") + Keys.onEnterPressed: doRename(groupName.text) + Keys.onReturnPressed: doRename(groupName.text) + } }