2021-10-01 15:58:36 +00:00
|
|
|
import QtQuick 2.3
|
|
|
|
import QtQuick.Controls 2.3
|
|
|
|
import QtQuick.Layouts 1.3
|
|
|
|
import Qt.labs.platform 1.1
|
|
|
|
|
|
|
|
import utils 1.0
|
2021-10-27 21:27:49 +00:00
|
|
|
import shared 1.0
|
|
|
|
import shared.panels 1.0
|
2021-10-21 23:34:35 +00:00
|
|
|
|
|
|
|
import StatusQ.Components 0.1
|
|
|
|
import StatusQ.Core 0.1
|
2021-10-01 15:58:36 +00:00
|
|
|
|
|
|
|
Item {
|
|
|
|
id: channelBadge
|
|
|
|
|
|
|
|
property int realChatType: -1
|
|
|
|
property string name: "channelName"
|
|
|
|
property color textColor
|
|
|
|
property string chatId: ""
|
|
|
|
property string profileImage: ""
|
|
|
|
property string identicon
|
|
|
|
|
|
|
|
SVGImage {
|
|
|
|
id: channelIcon
|
|
|
|
width: 16
|
|
|
|
height: 16
|
|
|
|
fillMode: Image.PreserveAspectFit
|
2021-12-09 12:53:40 +00:00
|
|
|
source: Style.svg("channel-icon-" + (realChatType === Constants.chatType.publicChat ? "public-chat" : "group"))
|
2021-10-01 15:58:36 +00:00
|
|
|
anchors.left: parent.left
|
|
|
|
anchors.verticalCenter:parent.verticalCenter
|
|
|
|
}
|
|
|
|
|
2021-10-21 23:34:35 +00:00
|
|
|
StatusSmartIdenticon {
|
2021-10-01 15:58:36 +00:00
|
|
|
id: contactImage
|
|
|
|
anchors.left: channelIcon.right
|
|
|
|
anchors.leftMargin: 4
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
2021-10-21 23:34:35 +00:00
|
|
|
image: StatusImageSettings {
|
|
|
|
width: 16
|
|
|
|
height: 16
|
|
|
|
source: profileImage || identicon
|
|
|
|
isIdenticon: true
|
|
|
|
}
|
|
|
|
icon: StatusIconSettings {
|
|
|
|
width: 16
|
|
|
|
height: 16
|
|
|
|
letterSize: 11
|
|
|
|
}
|
|
|
|
name: channelBadge.name
|
2021-10-01 15:58:36 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
StyledText {
|
|
|
|
id: contactInfo
|
2021-12-09 12:53:40 +00:00
|
|
|
text: realChatType !== Constants.chatType.publicChat ?
|
2021-10-01 15:58:36 +00:00
|
|
|
Emoji.parse(Utils.removeStatusEns(Utils.filterXSS(name))) :
|
|
|
|
"#" + Utils.filterXSS(name)
|
|
|
|
anchors.left: contactImage.right
|
|
|
|
anchors.leftMargin: 4
|
|
|
|
color: textColor
|
|
|
|
font.weight: Font.Medium
|
|
|
|
font.pixelSize: 13
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
}
|
|
|
|
}
|