status-desktop/ui/app/AppLayouts/Chat/popups/RenameGroupPopup.qml

52 lines
1.2 KiB
QML
Raw Normal View History

2020-06-17 19:18:31 +00:00
import QtQuick 2.13
import QtQuick.Controls 2.13
import QtQuick.Layouts 1.13
import utils 1.0
import shared.controls 1.0
import StatusQ.Controls 0.1
import StatusQ.Popups 0.1
StatusModal {
2020-06-15 12:51:04 +00:00
id: popup
height: 210
anchors.centerIn: parent
2020-06-15 12:51:04 +00:00
header.title: qsTr("Group name")
2020-06-15 12:51:04 +00:00
property string activeChannelName
signal doRename(string groupName)
2020-06-15 12:51:04 +00:00
onOpened: {
groupName.forceActiveFocus(Qt.MouseFocusReason)
groupName.text = popup.activeChannelName;
2020-06-15 12:51:04 +00:00
}
contentItem: Item {
2022-02-09 09:43:23 +00:00
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)
}
2020-06-15 12:51:04 +00:00
}
rightButtons: [
StatusButton {
id: saveBtn
text: qsTr("Save")
onClicked : { doRename(groupName.text) }
}
]
2020-06-15 12:51:04 +00:00
}