add default properties to message component

This commit is contained in:
Iuri Matias 2020-05-28 11:55:52 -04:00
parent 3b8408d21a
commit 2f428ef41d
2 changed files with 28 additions and 2 deletions

View File

@ -11,7 +11,14 @@ ListView {
model: chatsModel.messageList model: chatsModel.messageList
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true Layout.fillHeight: true
delegate: Message {} delegate: Message {
userName: model.userName
message: model.message
identicon: model.identicon
isCurrentUser: model.isCurrentUser
repeatMessageInfo: model.repeatMessageInfo
timestamp: model.timestamp
}
highlightFollowsCurrentItem: true highlightFollowsCurrentItem: true
onCountChanged: { onCountChanged: {
@ -27,3 +34,9 @@ ListView {
} }
} }
} }
/*##^##
Designer {
D{i:0;autoSize:true;height:480;width:640}
}
##^##*/

View File

@ -7,6 +7,13 @@ import "../../../../shared"
import "../../../../imports" import "../../../../imports"
Rectangle { Rectangle {
property string userName: "Jotaro Kujo"
property string message: "That's right. We're friends... Of justice, that is."
property string identicon: "data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAAEAAAABCAQAAAC1HAwCAAAAC0lEQVR42mNk+A8AAQUBAScY42YAAAAASUVORK5CYII="
property bool isCurrentUser: false
property bool repeatMessageInfo: true
property int timestamp: 1234567
id: chatBox id: chatBox
height: repeatMessageInfo ? 60 + chatText.height : 5 + chatText.height height: repeatMessageInfo ? 60 + chatText.height : 5 + chatText.height
color: "#00000000" color: "#00000000"
@ -82,3 +89,9 @@ Rectangle {
visible: repeatMessageInfo visible: repeatMessageInfo
} }
} }
/*##^##
Designer {
D{i:0;height:80;width:500}
}
##^##*/