mirror of
https://github.com/status-im/status-desktop.git
synced 2025-02-13 07:06:58 +00:00
fix: fix communities not showing the letter identicon correctly
This commit is contained in:
parent
c28d4054ef
commit
686cbc7f54
@ -148,11 +148,28 @@ ModalPopup {
|
||||
height: visible ? communityImage.height + Style.current.padding : 0
|
||||
width: parent.width
|
||||
|
||||
RoundedImage {
|
||||
Loader {
|
||||
id: communityImage
|
||||
sourceComponent: !!thumbnailImage ? commmunityImgCmp : letterIdenticonCmp
|
||||
}
|
||||
|
||||
Component {
|
||||
id: commmunityImgCmp
|
||||
RoundedImage {
|
||||
source: thumbnailImage
|
||||
width: 40
|
||||
height: 40
|
||||
source: thumbnailImage
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: letterIdenticonCmp
|
||||
StatusLetterIdenticon {
|
||||
width: 40
|
||||
height: 40
|
||||
chatName: name
|
||||
color: communityColor || Style.current.blue
|
||||
}
|
||||
}
|
||||
|
||||
StyledText {
|
||||
|
@ -17,6 +17,7 @@ ModalPopup {
|
||||
property bool canJoin: community.canJoin
|
||||
property bool canRequestAccess: community.canRequestAccess
|
||||
property bool isMember: community.isMember
|
||||
property string communityColor: community.communityColor || Style.current.blue
|
||||
|
||||
id: popup
|
||||
|
||||
@ -24,12 +25,30 @@ ModalPopup {
|
||||
height: childrenRect.height
|
||||
width: parent.width
|
||||
|
||||
RoundedImage {
|
||||
|
||||
Loader {
|
||||
id: communityImg
|
||||
sourceComponent: !!popup.source ? commmunityImgCmp : letterIdenticonCmp
|
||||
}
|
||||
|
||||
Component {
|
||||
id: commmunityImgCmp
|
||||
RoundedImage {
|
||||
source: popup.source
|
||||
width: 40
|
||||
height: 40
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: letterIdenticonCmp
|
||||
StatusLetterIdenticon {
|
||||
width: 40
|
||||
height: 40
|
||||
chatName: popup.name
|
||||
color: popup.communityColor
|
||||
}
|
||||
}
|
||||
|
||||
StyledTextEdit {
|
||||
id: communityName
|
||||
|
@ -2,6 +2,7 @@ import QtQuick 2.13
|
||||
import QtQuick.Controls 2.13
|
||||
import QtQuick.Layouts 1.13
|
||||
import "../../../../shared"
|
||||
import "../../../../shared/status"
|
||||
import "../../../../imports"
|
||||
import "../components"
|
||||
import "./"
|
||||
@ -18,14 +19,34 @@ Button {
|
||||
|
||||
contentItem: Item {
|
||||
id: content
|
||||
RoundedImage {
|
||||
Loader {
|
||||
id: communityImage
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
active: true
|
||||
sourceComponent: !chatsModel.communities.activeCommunity.thumbnailImage ? letterIdenticon : imageIcon
|
||||
}
|
||||
|
||||
Component {
|
||||
id: imageIcon
|
||||
RoundedImage {
|
||||
width: 40
|
||||
height: 40
|
||||
source: chatsModel.communities.activeCommunity.thumbnailImage
|
||||
anchors.verticalCenter: parent.verticalCenter
|
||||
noHover: true
|
||||
noMouseArea: true
|
||||
}
|
||||
}
|
||||
|
||||
Component {
|
||||
id: letterIdenticon
|
||||
StatusLetterIdenticon {
|
||||
width: 40
|
||||
height: 40
|
||||
chatName: chatsModel.communities.activeCommunity.name
|
||||
color: chatsModel.communities.activeCommunity.communityColor || Style.current.blue
|
||||
}
|
||||
}
|
||||
|
||||
|
||||
|
||||
StyledText {
|
||||
id: communityName
|
||||
|
@ -59,7 +59,7 @@ ModalPopup {
|
||||
width: 40
|
||||
height: 40
|
||||
chatName: popup.name
|
||||
color: popup.communityColor
|
||||
color: popup.communityColor || Style.current.blue
|
||||
}
|
||||
}
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user