status-desktop/ui/app/AppLayouts/Chat/components/PrivateChatPopup.qml

73 lines
1.8 KiB
QML
Raw Normal View History

2020-05-28 12:56:43 +00:00
import QtQuick 2.12
import QtQuick.Controls 2.3
import QtQuick.Layouts 1.3
import "../../../../imports"
import "../../../../shared"
import "./"
2020-05-29 16:27:50 +00:00
ModalPopup {
2020-05-28 12:56:43 +00:00
id: popup
2020-05-29 16:27:50 +00:00
title: qsTr("New chat")
2020-05-29 18:38:11 +00:00
onOpened: {
chatKey.text = "";
chatKey.forceActiveFocus(Qt.MouseFocusReason)
}
2020-05-29 16:27:50 +00:00
Rectangle {
id: chatKeyBox
height: 44
color: Theme.grey
2020-06-03 20:33:36 +00:00
anchors.top: parent.top
2020-05-28 12:56:43 +00:00
radius: 8
2020-05-29 16:27:50 +00:00
anchors.right: parent.right
anchors.left: parent.left
TextField {
id: chatKey
placeholderText: qsTr("Enter ENS username or chat key")
2020-05-28 12:56:43 +00:00
anchors.left: parent.left
anchors.leftMargin: 16
2020-05-29 16:27:50 +00:00
anchors.verticalCenter: parent.verticalCenter
font.pixelSize: 15
background: Rectangle {
color: "#00000000"
}
width: chatKeyBox.width - 32
2020-05-28 12:56:43 +00:00
}
2020-05-29 16:27:50 +00:00
MouseArea {
id: mouseArea
anchors.fill: parent
onClicked : {
chatKey.forceActiveFocus(Qt.MouseFocusReason)
2020-05-28 12:56:43 +00:00
}
}
2020-05-29 16:27:50 +00:00
}
2020-05-28 12:56:43 +00:00
2020-05-29 16:27:50 +00:00
footer: Button {
width: 44
height: 44
anchors.bottom: parent.bottom
anchors.right: parent.right
Image {
source: chatKey.text == "" ? "../../../img/arrow-button-inactive.svg" : "../../../img/arrow-btn-active.svg"
2020-05-28 12:56:43 +00:00
}
2020-05-29 16:27:50 +00:00
background: Rectangle {
color: "transparent"
2020-05-28 12:56:43 +00:00
}
2020-05-29 16:27:50 +00:00
MouseArea {
id: btnMAnewChat
cursorShape: Qt.PointingHandCursor
anchors.fill: parent
onClicked : {
if(chatKey.text === "") return;
chatsModel.joinChat(chatKey.text, Constants.chatTypeOneToOne);
popup.close();
2020-05-28 12:56:43 +00:00
}
}
}
}