2020-09-22 14:45:09 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import "../../imports"
|
|
|
|
import "../../shared"
|
|
|
|
import "../../shared/status"
|
|
|
|
|
|
|
|
Item {
|
|
|
|
id: root
|
|
|
|
|
2021-03-02 20:43:32 +00:00
|
|
|
property string chatId
|
2020-09-22 14:45:09 +00:00
|
|
|
property string chatName
|
|
|
|
property int chatType
|
|
|
|
property string identicon
|
2021-05-28 17:35:21 +00:00
|
|
|
property int letterSize: 15
|
2020-09-22 14:45:09 +00:00
|
|
|
|
|
|
|
width: 40
|
|
|
|
height: 40
|
|
|
|
|
|
|
|
Loader {
|
2020-12-04 10:28:55 +00:00
|
|
|
sourceComponent: root.chatType == Constants.chatTypeOneToOne || !!root.identicon ? imageIdenticon : letterIdenticon
|
2020-09-22 14:45:09 +00:00
|
|
|
anchors.fill: parent
|
|
|
|
}
|
|
|
|
|
|
|
|
Component {
|
|
|
|
id: letterIdenticon
|
|
|
|
|
|
|
|
StatusLetterIdenticon {
|
2021-03-02 20:43:32 +00:00
|
|
|
chatId: root.chatId
|
2020-09-22 14:45:09 +00:00
|
|
|
chatName: root.chatName
|
|
|
|
width: parent.width
|
|
|
|
height: parent.height
|
2021-05-28 17:35:21 +00:00
|
|
|
letterSize: root.letterSize
|
2020-09-22 14:45:09 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
Component {
|
|
|
|
id: imageIdenticon
|
|
|
|
|
|
|
|
StatusImageIdenticon {
|
|
|
|
source: root.identicon
|
|
|
|
width: parent.width
|
|
|
|
height: parent.height
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|