2020-09-22 14:50:14 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Controls 2.13
|
|
|
|
import "../../imports"
|
|
|
|
import "../../shared"
|
|
|
|
import "../../shared/status"
|
|
|
|
|
|
|
|
Button {
|
|
|
|
id: control
|
|
|
|
|
2020-10-02 19:25:33 +00:00
|
|
|
property string chatId
|
2020-09-22 14:50:14 +00:00
|
|
|
property string chatName
|
|
|
|
property int chatType
|
|
|
|
property string identicon
|
|
|
|
property int identiconSize: 40
|
|
|
|
property bool isCompact: false
|
2021-01-15 18:36:42 +00:00
|
|
|
property bool muted: false
|
2020-09-22 14:50:14 +00:00
|
|
|
|
|
|
|
implicitHeight: 48
|
|
|
|
implicitWidth: content.width + 8
|
|
|
|
leftPadding: 4
|
|
|
|
rightPadding: 4
|
|
|
|
|
|
|
|
contentItem: StatusChatInfo {
|
|
|
|
id: content
|
2020-10-02 19:25:33 +00:00
|
|
|
chatId: control.chatId
|
2020-09-22 14:50:14 +00:00
|
|
|
chatName: control.chatName
|
|
|
|
chatType: control.chatType
|
2021-01-15 18:36:42 +00:00
|
|
|
muted: control.muted
|
2020-11-30 17:03:52 +00:00
|
|
|
identicon: {
|
|
|
|
if (control.chatType === Constants.chatTypeOneToOne) {
|
2020-12-21 12:08:44 +00:00
|
|
|
return appMain.getProfileImage(control.chatId) || control.identicon
|
2020-11-30 17:03:52 +00:00
|
|
|
}
|
|
|
|
return control.identicon
|
|
|
|
}
|
2020-09-22 14:50:14 +00:00
|
|
|
identiconSize: control.identiconSize
|
|
|
|
isCompact: control.isCompact
|
|
|
|
}
|
|
|
|
|
|
|
|
background: Rectangle {
|
2021-02-18 19:07:23 +00:00
|
|
|
color: control.hovered ? Style.current.backgroundHover : "transparent"
|
2020-09-22 14:50:14 +00:00
|
|
|
radius: Style.current.radius
|
|
|
|
}
|
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
cursorShape: Qt.PointingHandCursor
|
|
|
|
anchors.fill: parent
|
|
|
|
onPressed: mouse.accepted = false
|
|
|
|
}
|
|
|
|
}
|