2020-12-15 16:04:19 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Controls 2.13
|
|
|
|
import QtQuick.Layouts 1.13
|
|
|
|
import "../../../../shared"
|
|
|
|
import "../../../../imports"
|
|
|
|
import "../components"
|
|
|
|
import "./"
|
|
|
|
|
|
|
|
Button {
|
|
|
|
implicitWidth: Math.max(communityImage.width + communityName.width + Style.current.padding, 200)
|
|
|
|
implicitHeight: communityImage.height + Style.current.padding
|
|
|
|
|
|
|
|
background: Rectangle {
|
|
|
|
id: btnBackground
|
|
|
|
radius: Style.current.radius
|
|
|
|
}
|
|
|
|
|
|
|
|
contentItem: Item {
|
|
|
|
id: content
|
|
|
|
RoundedImage {
|
|
|
|
id: communityImage
|
|
|
|
width: 40
|
|
|
|
height: 40
|
2021-02-17 16:47:12 +00:00
|
|
|
source: chatsModel.communities.activeCommunity.thumbnailImage
|
2020-12-15 16:04:19 +00:00
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
}
|
|
|
|
|
|
|
|
StyledText {
|
|
|
|
id: communityName
|
2021-02-11 20:37:31 +00:00
|
|
|
text: chatsModel.communities.activeCommunity.name
|
2020-12-15 16:04:19 +00:00
|
|
|
anchors.left: communityImage.right
|
|
|
|
anchors.leftMargin: Style.current.halfPadding
|
|
|
|
anchors.top: parent.top
|
|
|
|
font.pixelSize: 15
|
|
|
|
font.weight: Font.Medium
|
|
|
|
}
|
|
|
|
|
|
|
|
StyledText {
|
|
|
|
id: communityNbMember
|
2021-02-11 20:37:31 +00:00
|
|
|
text: chatsModel.communities.activeCommunity.nbMembers === 1 ?
|
|
|
|
qsTr("1 member") :
|
|
|
|
qsTr("%1 members").arg(chatsModel.communities.activeCommunity.nbMembers)
|
2020-12-15 16:04:19 +00:00
|
|
|
anchors.left: communityName.left
|
|
|
|
anchors.top: communityName.bottom
|
|
|
|
font.pixelSize: 12
|
|
|
|
font.weight: Font.Thin
|
|
|
|
color: Style.current.secondaryText
|
|
|
|
}
|
|
|
|
}
|
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
id: mouseAreaBtn
|
|
|
|
cursorShape: Qt.PointingHandCursor
|
|
|
|
anchors.fill: parent
|
|
|
|
onPressed: communityProfilePopup.open();
|
|
|
|
hoverEnabled: true
|
|
|
|
onExited: {
|
|
|
|
btnBackground.color = "transparent"
|
|
|
|
}
|
|
|
|
onEntered: {
|
2021-02-18 19:07:23 +00:00
|
|
|
btnBackground.color = Style.current.backgroundHover
|
2020-12-15 16:04:19 +00:00
|
|
|
}
|
|
|
|
}
|
2021-02-17 16:47:12 +00:00
|
|
|
}
|