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
|
2021-10-01 15:58:36 +00:00
|
|
|
import "../helpers/channelList.js" as ChannelJSON
|
2021-10-19 08:56:57 +00:00
|
|
|
|
|
|
|
import StatusQ.Core 0.1
|
|
|
|
import StatusQ.Core.Theme 0.1
|
|
|
|
import StatusQ.Controls 0.1 as StatusQControls
|
|
|
|
|
2021-10-27 21:27:49 +00:00
|
|
|
import shared 1.0
|
|
|
|
import shared.panels 1.0
|
|
|
|
import shared.popups 1.0
|
|
|
|
import shared.status 1.0
|
2021-09-28 15:04:06 +00:00
|
|
|
|
|
|
|
import utils 1.0
|
2020-05-28 00:21:02 +00:00
|
|
|
|
2020-09-23 20:32:51 +00:00
|
|
|
Rectangle {
|
2020-07-08 19:59:10 +00:00
|
|
|
id: emptyView
|
2020-05-28 00:21:02 +00:00
|
|
|
Layout.fillHeight: true
|
|
|
|
Layout.fillWidth: true
|
|
|
|
|
2022-01-28 08:19:49 +00:00
|
|
|
property var rootStore
|
|
|
|
|
2021-10-01 15:58:36 +00:00
|
|
|
signal suggestedMessageClicked(string channel)
|
|
|
|
|
2020-09-23 20:32:51 +00:00
|
|
|
height: suggestionContainer.height + inviteFriendsContainer.height + Style.current.padding * 2
|
2021-03-26 17:57:30 +00:00
|
|
|
border.color: Style.current.secondaryMenuBorder
|
2020-09-23 20:32:51 +00:00
|
|
|
radius: 16
|
|
|
|
color: Style.current.transparent
|
2020-09-23 16:49:20 +00:00
|
|
|
|
2020-12-04 14:24:28 +00:00
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: Style.current.padding
|
|
|
|
anchors.rightMargin: Style.current.padding
|
|
|
|
|
2020-09-23 20:32:51 +00:00
|
|
|
Item {
|
|
|
|
id: inviteFriendsContainer
|
|
|
|
height: visible ? 190 : 0
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.topMargin: 0
|
2020-05-28 00:21:02 +00:00
|
|
|
anchors.right: parent.right
|
2020-09-23 20:32:51 +00:00
|
|
|
anchors.rightMargin: 0
|
2020-05-28 00:21:02 +00:00
|
|
|
anchors.left: parent.left
|
2020-09-23 20:32:51 +00:00
|
|
|
anchors.leftMargin: 0
|
2020-05-28 00:21:02 +00:00
|
|
|
|
2020-09-23 20:32:51 +00:00
|
|
|
SVGImage {
|
|
|
|
anchors.top: parent.top
|
|
|
|
anchors.topMargin: -6
|
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
2021-09-28 15:04:06 +00:00
|
|
|
source: Style.svg("chatEmptyHeader")
|
2020-09-23 20:32:51 +00:00
|
|
|
width: 66
|
|
|
|
height: 50
|
|
|
|
}
|
|
|
|
|
2021-10-18 10:34:16 +00:00
|
|
|
|
|
|
|
StatusQControls.StatusFlatRoundButton {
|
2020-09-23 20:32:51 +00:00
|
|
|
id: closeImg
|
2021-10-18 10:34:16 +00:00
|
|
|
implicitWidth: 32
|
|
|
|
implicitHeight: 32
|
2020-07-08 19:19:34 +00:00
|
|
|
anchors.top: parent.top
|
2020-09-23 20:32:51 +00:00
|
|
|
anchors.topMargin: 10
|
2020-07-08 19:19:34 +00:00
|
|
|
anchors.right: parent.right
|
2020-09-23 20:32:51 +00:00
|
|
|
anchors.rightMargin: 10
|
2021-05-05 16:46:25 +00:00
|
|
|
icon.height: 20
|
|
|
|
icon.width: 20
|
2021-10-18 10:34:16 +00:00
|
|
|
icon.name: "close-circle"
|
|
|
|
type: StatusQControls.StatusFlatRoundButton.Type.Tertiary
|
2021-10-20 09:50:50 +00:00
|
|
|
onClicked: {
|
|
|
|
localAccountSensitiveSettings.hideChannelSuggestions = true
|
|
|
|
}
|
2020-09-23 20:32:51 +00:00
|
|
|
}
|
|
|
|
|
2021-10-19 08:56:57 +00:00
|
|
|
StatusBaseText {
|
2020-09-23 20:32:51 +00:00
|
|
|
id: chatAndTransactText
|
|
|
|
//% "Chat and transact privately with your friends"
|
|
|
|
text: qsTrId("chat-and-transact-privately-with-your-friends")
|
|
|
|
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
|
2020-07-08 19:19:34 +00:00
|
|
|
anchors.left: parent.left
|
2020-09-23 20:32:51 +00:00
|
|
|
anchors.leftMargin: Style.current.xlPadding
|
2021-10-19 08:56:57 +00:00
|
|
|
color: Theme.palette.directColor1
|
2020-09-23 20:32:51 +00:00
|
|
|
}
|
2020-05-28 00:21:02 +00:00
|
|
|
|
2021-10-19 08:56:57 +00:00
|
|
|
StatusQControls.StatusButton {
|
2020-09-23 20:32:51 +00:00
|
|
|
//% "Invite friends"
|
2021-01-28 11:04:10 +00:00
|
|
|
text: qsTrId("invite-friends")
|
2020-09-23 20:32:51 +00:00
|
|
|
anchors.horizontalCenter: parent.horizontalCenter
|
|
|
|
anchors.bottom: parent.bottom
|
|
|
|
anchors.bottomMargin: Style.current.xlPadding
|
|
|
|
onClicked: {
|
|
|
|
inviteFriendsPopup.open()
|
2020-05-28 00:21:02 +00:00
|
|
|
}
|
2020-09-23 20:32:51 +00:00
|
|
|
}
|
2020-07-08 19:19:34 +00:00
|
|
|
|
2020-09-23 20:32:51 +00:00
|
|
|
InviteFriendsPopup {
|
|
|
|
id: inviteFriendsPopup
|
2022-01-28 08:19:49 +00:00
|
|
|
rootStore: emptyView.rootStore
|
2022-02-09 09:43:23 +00:00
|
|
|
}
|
2020-09-23 20:32:51 +00:00
|
|
|
}
|
2020-07-08 19:19:34 +00:00
|
|
|
|
2020-09-23 20:32:51 +00:00
|
|
|
Separator {
|
|
|
|
anchors.topMargin: 0
|
|
|
|
anchors.top: inviteFriendsContainer.bottom
|
|
|
|
color: Style.current.border
|
|
|
|
}
|
2020-07-08 19:19:34 +00:00
|
|
|
|
2020-09-23 20:32:51 +00:00
|
|
|
Item {
|
|
|
|
id: suggestionContainer
|
|
|
|
anchors.top: inviteFriendsContainer.bottom
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.leftMargin: Style.current.padding
|
|
|
|
anchors.rightMargin: Style.current.padding
|
2020-07-09 15:21:45 +00:00
|
|
|
|
2020-09-23 20:32:51 +00:00
|
|
|
height: {
|
|
|
|
if (!visible) return 0
|
|
|
|
var totalHeight = 0
|
|
|
|
for (let i = 0; i < sectionRepeater.count; i++) {
|
|
|
|
totalHeight += sectionRepeater.itemAt(i).height + Style.current.padding
|
2020-05-28 00:21:02 +00:00
|
|
|
}
|
2020-09-23 20:32:51 +00:00
|
|
|
return suggestionsText.height + totalHeight + Style.current.smallPadding
|
2020-07-08 19:19:34 +00:00
|
|
|
}
|
|
|
|
|
2021-10-19 08:56:57 +00:00
|
|
|
StatusBaseText {
|
2020-09-23 20:32:51 +00:00
|
|
|
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
|
2020-07-08 19:19:34 +00:00
|
|
|
anchors.right: parent.right
|
2020-09-23 20:32:51 +00:00
|
|
|
anchors.rightMargin: Style.current.xlPadding
|
2020-07-08 19:19:34 +00:00
|
|
|
anchors.left: parent.left
|
2020-09-23 20:32:51 +00:00
|
|
|
anchors.leftMargin: Style.current.xlPadding
|
2021-10-19 08:56:57 +00:00
|
|
|
color: Theme.palette.directColor1
|
2020-09-23 20:32:51 +00:00
|
|
|
}
|
2020-07-08 19:19:34 +00:00
|
|
|
|
2020-09-23 20:32:51 +00:00
|
|
|
Item {
|
|
|
|
anchors.top: suggestionsText.bottom
|
|
|
|
anchors.topMargin: Style.current.smallPadding
|
|
|
|
width: parent.width
|
2020-09-23 17:42:15 +00:00
|
|
|
|
2021-10-01 15:58:36 +00:00
|
|
|
SuggestedChannelsPanel {
|
2020-09-23 20:32:51 +00:00
|
|
|
id: sectionRepeater
|
2021-10-01 15:58:36 +00:00
|
|
|
onSuggestedMessageClicked: emptyView.suggestedMessageClicked(channel)
|
2020-09-23 19:11:27 +00:00
|
|
|
}
|
2020-05-28 00:21:02 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|