mirror of
https://github.com/status-im/status-desktop.git
synced 2025-01-09 22:06:25 +00:00
90dfa94805
Prior to this commit, the function was expected on a `chatView` QML object. This has worked out so far because the places where the API is used were always living inside `ChatLayout`. With the new timeline however, this is no longer the case so we have to make sure that the API is available to other views as well.
48 lines
1.2 KiB
QML
48 lines
1.2 KiB
QML
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
|
|
identicon: {
|
|
if (control.chatType === Constants.chatTypeOneToOne) {
|
|
return appMain.getProfileImage(control.chatId) || control.identicon
|
|
}
|
|
return control.identicon
|
|
}
|
|
identiconSize: control.identiconSize
|
|
isCompact: control.isCompact
|
|
}
|
|
|
|
background: Rectangle {
|
|
color: control.hovered ? Style.current.topBarChatInfoColor : "transparent"
|
|
radius: Style.current.radius
|
|
}
|
|
|
|
MouseArea {
|
|
cursorShape: Qt.PointingHandCursor
|
|
anchors.fill: parent
|
|
onPressed: mouse.accepted = false
|
|
}
|
|
}
|