status-desktop/ui/shared/status/StatusChatInfoButton.qml

48 lines
1.2 KiB
QML
Raw Normal View History

import QtQuick 2.13
import QtQuick.Controls 2.13
import "../../imports"
import "../../shared"
import "../../shared/status"
Button {
id: control
property string chatId
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
chatId: control.chatId
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
}
identiconSize: control.identiconSize
isCompact: control.isCompact
}
background: Rectangle {
2020-09-28 17:11:15 +00:00
color: control.hovered ? Style.current.topBarChatInfoColor : "transparent"
radius: Style.current.radius
}
MouseArea {
cursorShape: Qt.PointingHandCursor
anchors.fill: parent
onPressed: mouse.accepted = false
}
}