Add small icon to items in chat list depending on type

This commit is contained in:
Richard Ramos 2020-06-11 21:00:28 -04:00 committed by Iuri Matias
parent 67c7e9b0ca
commit b3a9bff381
3 changed files with 25 additions and 2 deletions

View File

@ -41,6 +41,19 @@ Rectangle {
channelIdenticon: identicon
}
Image {
id: channelIcon
width: 16
height: 16
fillMode: Image.PreserveAspectFit
source: "../../../img/channel-icon-" + (chatType == Constants.chatTypePublic ? "public-chat.svg" : "group.svg")
anchors.left: contactImage.right
anchors.leftMargin: Theme.padding
anchors.top: parent.top
anchors.topMargin: Theme.smallPadding
visible: chatType != Constants.chatTypeOneToOne
}
Text {
id: contactInfo
text: chatType != Constants.chatTypePublic ? name : "#" + name
@ -49,8 +62,8 @@ Rectangle {
elide: Text.ElideRight
font.weight: Font.Medium
font.pixelSize: 15
anchors.left: contactImage.right
anchors.leftMargin: Theme.padding
anchors.left: channelIcon.visible ? channelIcon.right : contactImage.right
anchors.leftMargin: channelIcon.visible ? 2 : Theme.padding
anchors.top: parent.top
anchors.topMargin: Theme.smallPadding
color: "black"

View File

@ -0,0 +1,6 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M8 7.5C9.24265 7.5 10.25 6.49264 10.25 5.25C10.25 4.00736 9.24265 3 8 3C6.75736 3 5.75 4.00736 5.75 5.25C5.75 6.49264 6.75736 7.5 8 7.5Z" fill="#939BA1"/>
<path d="M4.12343 12.0101C4.56395 10.2798 6.13252 9 8 9C9.86749 9 11.4361 10.2798 11.8766 12.0101C12.0128 12.5453 11.5523 13 11 13H5C4.44772 13 3.98718 12.5453 4.12343 12.0101Z" fill="#939BA1"/>
<path d="M4.5 7.25C4.5 8.2165 3.7165 9 2.75 9C1.7835 9 1 8.2165 1 7.25C1 6.2835 1.7835 5.5 2.75 5.5C3.7165 5.5 4.5 6.2835 4.5 7.25Z" fill="#939BA1"/>
<path d="M13.25 9C14.2165 9 15 8.2165 15 7.25C15 6.2835 14.2165 5.5 13.25 5.5C12.2835 5.5 11.5 6.2835 11.5 7.25C11.5 8.2165 12.2835 9 13.25 9Z" fill="#939BA1"/>
</svg>

After

Width:  |  Height:  |  Size: 773 B

View File

@ -0,0 +1,4 @@
<svg width="16" height="16" viewBox="0 0 16 16" fill="none" xmlns="http://www.w3.org/2000/svg">
<path d="M9.82051 4.60748C10.148 4.48152 10.5 4.72326 10.5 5.07415V10.9259C10.5 11.2768 10.148 11.5185 9.8205 11.3925L8.20145 10.7698C8.01814 10.6993 7.8324 10.6356 7.6446 10.5788C7.38272 10.4996 7.11478 10.664 7.04842 10.9294L6.66417 12.4664C6.36119 13.6784 4.63882 13.6784 4.33583 12.4664L3.74837 10.1166C3.70074 9.92607 3.54598 9.78107 3.35275 9.74594L2.82112 9.64928C2.34563 9.56283 2 9.14869 2 8.66541V7.33456C2 6.85127 2.34562 6.43714 2.82111 6.35069L6.76064 5.63441C7.25246 5.54499 7.73482 5.40967 8.20139 5.23022L9.82051 4.60748Z" fill="#939BA1"/>
<path d="M12.3205 12.3541C12.1274 12.2798 12 12.0943 12 11.8874V4.11261C12 3.90573 12.1274 3.72021 12.3205 3.64594L12.641 3.52267C13.296 3.27074 14 3.75423 14 4.45601V11.5441C14 12.2458 13.296 12.7293 12.641 12.4774L12.3205 12.3541Z" fill="#939BA1"/>
</svg>

After

Width:  |  Height:  |  Size: 910 B