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
|
|
|
|
|
|
|
|
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
|
2020-11-30 17:03:52 +00:00
|
|
|
identicon: {
|
|
|
|
if (control.chatType === Constants.chatTypeOneToOne) {
|
|
|
|
return chatView.getProfileImage(control.chatId) || control.identicon
|
|
|
|
}
|
|
|
|
return control.identicon
|
|
|
|
}
|
2020-09-22 14:50:14 +00:00
|
|
|
identiconSize: control.identiconSize
|
|
|
|
isCompact: control.isCompact
|
|
|
|
}
|
|
|
|
|
|
|
|
background: Rectangle {
|
2020-09-28 17:11:15 +00:00
|
|
|
color: control.hovered ? Style.current.topBarChatInfoColor : "transparent"
|
2020-09-22 14:50:14 +00:00
|
|
|
radius: Style.current.radius
|
|
|
|
}
|
|
|
|
|
|
|
|
MouseArea {
|
|
|
|
cursorShape: Qt.PointingHandCursor
|
|
|
|
anchors.fill: parent
|
|
|
|
onPressed: mouse.accepted = false
|
|
|
|
}
|
|
|
|
}
|