add default list to the chat messages

This commit is contained in:
Iuri Matias 2020-05-28 13:34:54 -04:00
parent 2f428ef41d
commit 0ee32c2bb1
5 changed files with 48 additions and 2 deletions

View File

@ -33,7 +33,9 @@ StackLayout {
Layout.fillHeight: true
Layout.alignment: Qt.AlignLeft | Qt.AlignTop
ChatMessages {}
ChatMessages {
messageList: chatsModel.messageList
}
}
RowLayout {

View File

@ -5,10 +5,12 @@ import QtQuick.Layouts 1.3
import Qt.labs.platform 1.1
import "../../../../shared"
import "../../../../imports"
import "./samples/"
ListView {
property var messageList: MessagesData {}
id: chatLogView
model: chatsModel.messageList
model: messageList
Layout.fillWidth: true
Layout.fillHeight: true
delegate: Message {

View File

@ -0,0 +1,40 @@
import QtQuick 2.3
import QtQuick.Controls 2.3
import QtQuick.Controls 2.12 as QQC2
import QtQuick.Layouts 1.3
import Qt.labs.platform 1.1
ListModel {
ListElement {
userName: "Ferocious Herringbone Sinewave"
message: "Everybody betrayed me! \n I'm fed up with this world."
repeatMessageInfo: true
}
ListElement {
userName: "Teenage Mutant Turtle"
message: "You're tearing me apart, Lisa!"
repeatMessageInfo: true
}
ListElement {
userName: "Teenage Mutant Turtle"
message: "It's bullshit, I did not hit her.\nI did nooot."
repeatMessageInfo: false
}
ListElement {
userName: "Teenage Mutant Turtle"
message: "Oh hi, Mark!"
repeatMessageInfo: false
}
ListElement {
userName: "me"
message: "Hi Johnny"
isCurrentUser: true
repeatMessageInfo: true
}
}
/*##^##
Designer {
D{i:0;autoSize:true;height:480;width:640}
}
##^##*/

View File

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

View File

@ -52,6 +52,7 @@ DISTFILES += \
Theme.qml \
app/AppLayouts/Browser/BrowserLayout.qml \
app/AppLayouts/Chat/ChatColumn.qml \
app/AppLayouts/Chat/ChatColumn/MessagesData.qml \
app/AppLayouts/Chat/ChatLayout.qml \
app/AppLayouts/Chat/ContactsColumn.qml \
app/AppLayouts/Chat/components/PublicChatPopup.qml \