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

132 lines
3.8 KiB
QML
Raw Normal View History

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 {
id: popup
2020-05-29 16:27:50 +00:00
title: qsTr("Join public chat")
2020-05-29 18:38:11 +00:00
onOpened: {
channelName.text = "";
channelName.forceActiveFocus(Qt.MouseFocusReason)
}
2020-05-29 16:27:50 +00:00
Row {
id: description
Layout.fillHeight: false
Layout.fillWidth: true
width: parent.width
Text {
2020-06-04 14:53:10 +00:00
width: parent.width
2020-05-29 16:27:50 +00:00
font.pixelSize: 15
text: qsTr("A public chat is where you get to hang out with others, make friends and talk about subjects of your interest.")
wrapMode: Text.WordWrap
verticalAlignment: Text.AlignTop
}
2020-05-29 16:27:50 +00:00
}
2020-05-29 16:27:50 +00:00
Rectangle {
id: channelNameBox
height: 44
color: Theme.grey
anchors.top: description.bottom
radius: 8
anchors.right: parent.right
anchors.left: parent.left
2020-05-29 16:27:50 +00:00
TextField {
id: channelName
placeholderText: qsTr("chat-name")
anchors.left: parent.left
2020-05-29 16:27:50 +00:00
anchors.leftMargin: 32
anchors.verticalCenter: parent.verticalCenter
font.pixelSize: 15
background: Rectangle {
color: "#00000000"
}
2020-05-29 16:27:50 +00:00
width: channelNameBox.width - 32
}
2020-05-29 16:27:50 +00:00
Image {
id: image4
anchors.left: parent.left
2020-05-29 16:27:50 +00:00
anchors.leftMargin: 10
anchors.verticalCenter: parent.verticalCenter
fillMode: Image.PreserveAspectFit
source: "../../../img/hash.svg"
}
2020-05-29 16:27:50 +00:00
MouseArea {
id: mouseArea
anchors.fill: parent
onClicked : {
channelName.forceActiveFocus(Qt.MouseFocusReason)
}
}
2020-05-29 16:27:50 +00:00
}
RowLayout {
id: row
Layout.fillHeight: false
Layout.fillWidth: true
anchors.right: parent.right
anchors.rightMargin: 65
anchors.left: parent.left
anchors.leftMargin: 65
anchors.top: channelNameBox.bottom
anchors.topMargin: 37
2020-05-29 16:27:50 +00:00
Flow {
Layout.fillHeight: false
Layout.fillWidth: true
2020-05-29 16:27:50 +00:00
spacing: 20
2020-05-29 16:27:50 +00:00
SuggestedChannel { channel: "ethereum" }
SuggestedChannel { channel: "status" }
SuggestedChannel { channel: "general" }
SuggestedChannel { channel: "dapps" }
SuggestedChannel { channel: "crypto" }
SuggestedChannel { channel: "introductions" }
SuggestedChannel { channel: "tech" }
SuggestedChannel { channel: "ama" }
SuggestedChannel { channel: "gaming" }
SuggestedChannel { channel: "sexychat" }
SuggestedChannel { channel: "nsfw" }
SuggestedChannel { channel: "science" }
SuggestedChannel { channel: "music" }
SuggestedChannel { channel: "movies" }
SuggestedChannel { channel: "sports" }
SuggestedChannel { channel: "politics" }
}
2020-05-29 16:27:50 +00:00
}
2020-05-29 16:27:50 +00:00
footer: Button {
width: 44
height: 44
anchors.bottom: parent.bottom
anchors.right: parent.right
background: Rectangle {
color: "transparent"
}
2020-05-29 16:27:50 +00:00
Image {
source: channelName.text == "" ? "../../../img/arrow-button-inactive.svg" : "../../../img/arrow-btn-active.svg"
}
MouseArea {
id: btnMAJoinChat
cursorShape: Qt.PointingHandCursor
anchors.fill: parent
onClicked : {
if(channelName.text === "") return;
2020-05-28 14:58:25 +00:00
chatsModel.joinChat(channelName.text, Constants.chatTypePublic);
2020-05-28 02:26:01 +00:00
popup.close();
}
}
}
2020-05-29 16:27:50 +00:00
}