2020-06-17 19:18:31 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Controls 2.13
|
|
|
|
import QtQuick.Layouts 1.13
|
2020-07-08 19:19:34 +00:00
|
|
|
import QtGraphicalEffects 1.13
|
2020-05-28 00:21:02 +00:00
|
|
|
import "../components"
|
2020-09-23 16:49:20 +00:00
|
|
|
import "../data/channelList.js" as ChannelJSON
|
2020-06-19 18:06:58 +00:00
|
|
|
import "../../../../shared"
|
2020-07-08 19:19:34 +00:00
|
|
|
import "../../../../imports"
|
2020-05-28 00:21:02 +00:00
|
|
|
|
2020-09-23 16:49:20 +00:00
|
|
|
//Item {
|
|
|
|
ScrollView {
|
|
|
|
// id: sview
|
|
|
|
clip: true
|
|
|
|
|
|
|
|
// anchors.top: suggestionsText.bottom
|
|
|
|
// anchors.topMargin: Style.current.smallPadding
|
|
|
|
// anchors.left: parent.left
|
|
|
|
// anchors.right: parent.right
|
|
|
|
// anchors.bottom: parent.bottom
|
|
|
|
|
|
|
|
ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
|
|
|
|
ScrollBar.vertical.policy: ScrollBar.AlwaysOn
|
|
|
|
// Layout.fillHeight: true
|
|
|
|
// Layout.fillWidth: true
|
2020-07-08 19:59:10 +00:00
|
|
|
property var onCloseButtonPressed: function () {}
|
|
|
|
|
|
|
|
id: emptyView
|
2020-05-28 00:21:02 +00:00
|
|
|
Layout.fillHeight: true
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
2020-09-23 16:49:20 +00:00
|
|
|
contentHeight: {
|
|
|
|
var totalHeight = 0
|
|
|
|
for (let i = 0; i < sectionRepeater.count; i++) {
|
|
|
|
totalHeight += sectionRepeater.itemAt(i).height + Style.current.padding
|
|
|
|
}
|
|
|
|
return inviteFriendsContainer.height + totalHeight + Style.current.padding
|
|
|
|
// return totalHeight
|
|
|
|
}
|
|
|
|
|
2020-07-08 19:19:34 +00:00
|
|
|
Rectangle {
|
2020-07-08 19:59:10 +00:00
|
|
|
id: emptyViewContent
|
2020-07-20 13:57:18 +00:00
|
|
|
border.color: Style.current.border
|
2020-07-08 19:19:34 +00:00
|
|
|
radius: 16
|
2020-05-28 00:21:02 +00:00
|
|
|
anchors.right: parent.right
|
2020-07-08 19:19:34 +00:00
|
|
|
anchors.rightMargin: Style.current.padding
|
2020-05-28 00:21:02 +00:00
|
|
|
anchors.left: parent.left
|
2020-07-08 19:19:34 +00:00
|
|
|
anchors.leftMargin: Style.current.padding
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.topMargin: Style.current.bigPadding
|
|
|
|
height: inviteFriendsContainer.height + suggestionContainer.height
|
2020-07-19 18:53:55 +00:00
|
|
|
color: Style.current.transparent
|
2020-05-28 00:21:02 +00:00
|
|
|
|
2020-07-08 19:19:34 +00:00
|
|
|
Item {
|
|
|
|
id: inviteFriendsContainer
|
|
|
|
height: 190
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.topMargin: 0
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.rightMargin: 0
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: 0
|
2020-05-28 00:21:02 +00:00
|
|
|
|
2020-07-08 19:19:34 +00:00
|
|
|
SVGImage {
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.topMargin: -6
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
2020-07-20 12:47:20 +00:00
|
|
|
source: "../../../img/chatEmptyHeader.svg"
|
|
|
|
width: 66
|
|
|
|
height: 50
|
2020-05-28 00:21:02 +00:00
|
|
|
}
|
2020-07-08 19:19:34 +00:00
|
|
|
|
|
|
|
SVGImage {
|
|
|
|
id: closeImg
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.topMargin: 10
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.rightMargin: 10
|
|
|
|
source: "../../../img/close.svg"
|
|
|
|
height: 20
|
|
|
|
width: 20
|
2020-05-28 00:21:02 +00:00
|
|
|
}
|
2020-07-08 19:19:34 +00:00
|
|
|
ColorOverlay {
|
|
|
|
anchors.fill: closeImg
|
|
|
|
source: closeImg
|
|
|
|
color: Style.current.darkGrey
|
2020-05-28 00:21:02 +00:00
|
|
|
}
|
2020-07-08 19:59:10 +00:00
|
|
|
MouseArea {
|
|
|
|
anchors.fill: closeImg
|
|
|
|
cursorShape: Qt.PointingHandCursor
|
|
|
|
onClicked: {
|
|
|
|
emptyView.onCloseButtonPressed()
|
|
|
|
}
|
|
|
|
}
|
2020-07-08 19:19:34 +00:00
|
|
|
|
2020-07-08 19:59:10 +00:00
|
|
|
StyledText {
|
2020-07-08 19:19:34 +00:00
|
|
|
id: chatAndTransactText
|
2020-07-16 15:20:29 +00:00
|
|
|
//% "Chat and transact privately with your friends"
|
|
|
|
text: qsTrId("chat-and-transact-privately-with-your-friends")
|
2020-07-08 19:19:34 +00:00
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.topMargin: 56
|
|
|
|
horizontalAlignment: Text.AlignHCenter
|
|
|
|
font.pixelSize: 15
|
|
|
|
wrapMode: Text.WordWrap
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.rightMargin: Style.current.xlPadding
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: Style.current.xlPadding
|
2020-05-28 00:21:02 +00:00
|
|
|
}
|
2020-07-08 19:19:34 +00:00
|
|
|
|
|
|
|
StyledButton {
|
2020-07-16 15:20:29 +00:00
|
|
|
//% "Invite friends"
|
|
|
|
label: qsTrId("invite-friends")
|
2020-07-08 19:19:34 +00:00
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
anchors.bottomMargin: Style.current.xlPadding
|
2020-07-09 15:21:45 +00:00
|
|
|
onClicked: {
|
|
|
|
inviteFriendsPopup.open()
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
InviteFriendsPopup {
|
|
|
|
id: inviteFriendsPopup
|
2020-05-28 00:21:02 +00:00
|
|
|
}
|
2020-07-08 19:19:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Separator {
|
|
|
|
anchors.topMargin: 0
|
|
|
|
anchors.top: inviteFriendsContainer.bottom
|
2020-07-20 13:57:18 +00:00
|
|
|
color: Style.current.border
|
2020-07-08 19:19:34 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
Item {
|
|
|
|
id: suggestionContainer
|
|
|
|
anchors.top: inviteFriendsContainer.bottom
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.left: parent.left
|
2020-09-23 16:49:20 +00:00
|
|
|
// height: suggestionsText.height + channelFlow.height + 2 * Style.current.xlPadding + Style.current.bigPadding
|
|
|
|
// height: suggestionsText.height + 2 * Style.current.xlPadding + Style.current.bigPadding
|
2020-07-08 19:19:34 +00:00
|
|
|
|
|
|
|
StyledText {
|
|
|
|
id: suggestionsText
|
|
|
|
width: parent.width
|
|
|
|
//% "Follow your interests in one of the many Public Chats."
|
|
|
|
text: qsTrId("follow-your-interests-in-one-of-the-many-public-chats.")
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.topMargin: Style.current.xlPadding
|
|
|
|
font.pointSize: 15
|
|
|
|
wrapMode: Text.WordWrap
|
|
|
|
verticalAlignment: Text.AlignTop
|
|
|
|
horizontalAlignment: Text.AlignHCenter
|
|
|
|
fontSizeMode: Text.FixedSize
|
|
|
|
renderType: Text.QtRendering
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.rightMargin: Style.current.xlPadding
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: Style.current.xlPadding
|
2020-05-28 00:21:02 +00:00
|
|
|
}
|
2020-07-08 19:19:34 +00:00
|
|
|
|
2020-09-23 16:49:20 +00:00
|
|
|
// ScrollView {
|
|
|
|
// id: sview
|
|
|
|
// clip: true
|
|
|
|
|
|
|
|
// anchors.top: suggestionsText.bottom
|
|
|
|
// anchors.topMargin: Style.current.smallPadding
|
|
|
|
// anchors.left: parent.left
|
|
|
|
// anchors.right: parent.right
|
|
|
|
// anchors.bottom: parent.bottom
|
|
|
|
|
|
|
|
// ScrollBar.horizontal.policy: ScrollBar.AlwaysOff
|
|
|
|
// ScrollBar.vertical.policy: ScrollBar.AlwaysOn
|
|
|
|
// Layout.fillHeight: true
|
|
|
|
// Layout.fillWidth: true
|
|
|
|
// contentHeight: {
|
|
|
|
// var totalHeight = 0
|
|
|
|
// for (let i = 0; i < sectionRepeater.count; i++) {
|
|
|
|
// totalHeight += sectionRepeater.itemAt(i).height + Style.current.padding
|
|
|
|
// }
|
|
|
|
// return totalHeight + Style.current.padding
|
|
|
|
// }
|
|
|
|
|
|
|
|
Repeater {
|
|
|
|
id: sectionRepeater
|
|
|
|
anchors.top: suggestionsText.bottom
|
|
|
|
anchors.topMargin: Style.current.smallPadding
|
|
|
|
// id: sview
|
|
|
|
model: ChannelJSON.categories
|
|
|
|
Item {
|
|
|
|
anchors.top: index === 0 ? suggestionsText.bottom : parent.children[index - 1].bottom
|
|
|
|
anchors.topMargin: index === 0 ? 0 : Style.current.padding
|
|
|
|
width: parent.width - Style.current.padding
|
|
|
|
// height: {
|
|
|
|
// return childrenRect.height
|
|
|
|
// }
|
|
|
|
|
|
|
|
height: {
|
|
|
|
var totalHeight = 0
|
|
|
|
for (let i = 0; i < channelRepeater.count; i++) {
|
|
|
|
totalHeight += channelRepeater.itemAt(i).height + Style.current.padding
|
|
|
|
}
|
|
|
|
return totalHeight
|
|
|
|
}
|
|
|
|
|
|
|
|
Text {
|
|
|
|
id: sectionTitle
|
|
|
|
text: modelData.name
|
|
|
|
font.bold: true
|
|
|
|
font.pixelSize: 16
|
|
|
|
}
|
|
|
|
Flow {
|
|
|
|
anchors.top: sectionTitle.bottom
|
|
|
|
anchors.topMargin: Style.current.smallPadding
|
|
|
|
Layout.fillHeight: true
|
|
|
|
Layout.fillWidth: true
|
|
|
|
width: parent.width
|
|
|
|
spacing: 10
|
|
|
|
Repeater {
|
|
|
|
id: channelRepeater
|
|
|
|
model: modelData.channels
|
|
|
|
SuggestedChannel { channel: modelData }
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
}
|
2020-07-08 19:19:34 +00:00
|
|
|
|
|
|
|
}
|
2020-09-23 16:49:20 +00:00
|
|
|
// }
|
|
|
|
|
|
|
|
// Flow {
|
|
|
|
// id: channelFlow
|
|
|
|
// Layout.fillHeight: false
|
|
|
|
// Layout.fillWidth: true
|
|
|
|
// spacing: 6
|
|
|
|
// anchors.right: parent.right
|
|
|
|
// anchors.rightMargin: Style.current.xlPadding
|
|
|
|
// anchors.left: parent.left
|
|
|
|
// anchors.leftMargin: Style.current.xlPadding
|
|
|
|
// anchors.top: suggestionsText.bottom
|
|
|
|
// anchors.topMargin: Style.current.bigPadding
|
|
|
|
|
|
|
|
// SuggestedChannel {
|
|
|
|
// channel: "introductions"
|
|
|
|
// }
|
|
|
|
// SuggestedChannel {
|
|
|
|
// channel: "chitchat"
|
|
|
|
// }
|
|
|
|
// SuggestedChannel {
|
|
|
|
// channel: "status"
|
|
|
|
// }
|
|
|
|
// SuggestedChannel {
|
|
|
|
// channel: "crypto"
|
|
|
|
// }
|
|
|
|
// SuggestedChannel {
|
|
|
|
// channel: "tech"
|
|
|
|
// }
|
|
|
|
// SuggestedChannel {
|
|
|
|
// channel: "music"
|
|
|
|
// }
|
|
|
|
// SuggestedChannel {
|
|
|
|
// channel: "movies"
|
|
|
|
// }
|
|
|
|
// SuggestedChannel {
|
|
|
|
// channel: "test"
|
|
|
|
// }
|
|
|
|
// SuggestedChannel {
|
|
|
|
// channel: "test2"
|
|
|
|
// }
|
|
|
|
// }
|
2020-05-28 00:21:02 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
2020-06-17 19:18:31 +00:00
|
|
|
|
|
|
|
/*##^##
|
|
|
|
Designer {
|
2020-07-08 19:19:34 +00:00
|
|
|
D{i:0;autoSize:true;formeditorColor:"#ffffff";formeditorZoom:1.25;height:500;width:300}
|
2020-06-17 19:18:31 +00:00
|
|
|
}
|
|
|
|
##^##*/
|