default views for when there is no chat opened + chat links

default views for when there is no chat opened + chat links

add channel component

update other layouts

fix problem with alias

add test channels

fix merge conflict
This commit is contained in:
Iuri Matias 2020-05-26 14:16:07 -04:00
parent e869d62c98
commit f4439fcb6f
7 changed files with 494 additions and 366 deletions

View File

@ -82,10 +82,10 @@ proc mainProc() =
)
# accountsModel.appEvents.on("accountsReady") do(a: Args):
appEvents.on("accountsReady") do(a: Args):
appState.addChannel("test")
appState.addChannel("test2")
appState.addChannel("status")
# appEvents.on("accountsReady") do(a: Args):
# appState.addChannel("test")
# appState.addChannel("test2")
# appState.addChannel("status")
engine.load("../ui/main.qml")

View File

@ -4,17 +4,15 @@ import QtQuick.Layouts 1.3
import Qt.labs.platform 1.1
import "../../../imports"
ColumnLayout {
StackLayout {
property int chatGroupsListViewCount: 0
Layout.fillHeight: true
Layout.fillWidth: true
currentIndex: chatGroupsListViewCount > 0 ? 0 : 1
ColumnLayout {
id: chatColumn
spacing: 0
anchors.left: contactsColumn.right
anchors.leftMargin: 0
anchors.right: parent.right
anchors.rightMargin: 0
anchors.bottom: parent.bottom
anchors.bottomMargin: 0
anchors.top: parent.top
anchors.topMargin: 0
RowLayout {
id: chatTopBar
@ -307,6 +305,33 @@ ColumnLayout {
}
}
}
}
ColumnLayout {
Layout.margins: 0
Layout.fillHeight: false
Layout.fillWidth: false
anchors.left: parent.left
anchors.leftMargin: 200
anchors.right: parent.right
anchors.rightMargin: 200
anchors.bottom: parent.bottom
anchors.bottomMargin: 200
anchors.top: parent.top
anchors.topMargin: 100
Image {
source: "../../../onboarding/img/chat@2x.jpg"
}
Text {
text: "Select a chat to start messaging"
font.weight: Font.DemiBold
font.pixelSize: 15
color: Theme.darkGrey
Layout.alignment: Qt.AlignHCenter | Qt.AlignVCenter
}
}
}
/*##^##

View File

@ -24,6 +24,7 @@ SplitView {
ChatColumn {
id: chatColumn
chatGroupsListViewCount: contactsColumn.chatGroupsListViewCount
}
}

View File

@ -3,8 +3,10 @@ import QtQuick.Controls 2.3
import QtQuick.Layouts 1.3
import Qt.labs.platform 1.1
import "../../../imports"
import "./components"
Item {
property alias chatGroupsListViewCount: chatGroupsListView.count
property alias searchStr: searchText.text
id: contactsColumn
@ -108,10 +110,75 @@ Item {
}
}
Item {
StackLayout {
Layout.fillHeight: true
Layout.fillWidth: true
currentIndex: chatGroupsListView.count > 0 ? 1 : 0
Item {
id: element1
Layout.fillHeight: true
Layout.fillWidth: true
ColumnLayout {
anchors.right: parent.right
anchors.rightMargin: 20
anchors.left: parent.left
anchors.leftMargin: 20
anchors.top: parent.top
anchors.topMargin: 20
Layout.fillHeight: true
Layout.fillWidth: true
Row {
id: description
Layout.fillHeight: false
Layout.fillWidth: true
width: parent.width
Text {
width: parent.width
text: qsTr("Follow your interests in one of the many Public Chats.")
font.pointSize: 15
wrapMode: Text.WordWrap
verticalAlignment: Text.AlignTop
horizontalAlignment: Text.AlignHCenter
fontSizeMode: Text.FixedSize
renderType: Text.QtRendering
onLinkActivated: console.log(link)
}
}
RowLayout {
id: row
Layout.fillHeight: false
Layout.fillWidth: true
anchors.right: parent.right
anchors.rightMargin: 0
anchors.left: parent.left
anchors.leftMargin: 0
anchors.top: description.bottom
anchors.topMargin: 20
Flow {
Layout.fillHeight: false
Layout.fillWidth: true
spacing: 6
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" }
}
}
}
}
Item {
Component {
id: chatViewDelegate
@ -220,6 +287,8 @@ Item {
}
}
}
}
}

View File

@ -0,0 +1,30 @@
import QtQuick 2.0
import "../../../../imports"
Rectangle {
property string channel: "status"
border.width: 1
radius: 8
width: children[0].width + 10
height: 32
border.color: Theme.grey
Text {
id: suggestedChannelText
text: "#" + channel
font.weight: Font.Medium
color: Theme.blue;
anchors.top: parent.top;
anchors.topMargin: 5;
anchors.left: parent.left;
anchors.leftMargin: 5;
horizontalAlignment: Text.AlignLeft;
font.pixelSize: 15
}
MouseArea {
anchors.fill: parent
onClicked: chatsModel.joinChat(channel)
cursorShape: Qt.PointingHandCursor
}
}

View File

@ -0,0 +1 @@
SuggestedChannel 1.0 SuggestedChannel.qml

View File

@ -53,6 +53,8 @@ DISTFILES += \
app/AppLayouts/Chat/ChatColumn.qml \
app/AppLayouts/Chat/ChatLayout.qml \
app/AppLayouts/Chat/ContactsColumn.qml \
app/AppLayouts/Chat/components/SuggestedChannel.qml \
app/AppLayouts/Chat/components/qmldir \
app/AppLayouts/Chat/qmldir \
app/AppLayouts/Node/NodeLayout.qml \
app/AppLayouts/Profile/ProfileLayout.qml \