2024-10-15 19:26:12 +00:00
|
|
|
import QtQuick 2.15
|
|
|
|
import QtQuick.Controls 2.15
|
|
|
|
import QtQuick.Layouts 1.15
|
2021-09-28 15:04:06 +00:00
|
|
|
|
|
|
|
import utils 1.0
|
2021-10-27 21:27:49 +00:00
|
|
|
import shared 1.0
|
|
|
|
import shared.panels 1.0
|
2022-04-07 19:05:33 +00:00
|
|
|
import shared.controls.chat 1.0
|
2021-10-20 22:47:23 +00:00
|
|
|
|
|
|
|
import StatusQ.Components 0.1
|
2024-10-15 19:26:12 +00:00
|
|
|
import StatusQ.Core.Theme 0.1
|
2021-05-26 17:36:24 +00:00
|
|
|
|
|
|
|
Rectangle {
|
2022-04-07 19:05:33 +00:00
|
|
|
property string contactPubKey
|
2022-01-04 12:06:05 +00:00
|
|
|
property string contactName
|
|
|
|
property string contactIcon
|
|
|
|
signal openProfilePopup()
|
|
|
|
signal blockContactActionTriggered()
|
2021-10-01 15:58:36 +00:00
|
|
|
signal acceptClicked()
|
|
|
|
signal declineClicked()
|
2021-05-26 17:36:24 +00:00
|
|
|
property bool isHovered: false
|
|
|
|
id: container
|
|
|
|
|
|
|
|
height: visible ? 64 : 0
|
|
|
|
anchors.right: parent.right
|
|
|
|
anchors.left: parent.left
|
|
|
|
border.width: 0
|
2024-10-15 19:26:12 +00:00
|
|
|
radius: Theme.radius
|
|
|
|
color: isHovered ? Theme.palette.backgroundHover : Theme.palette.transparent
|
2021-05-26 17:36:24 +00:00
|
|
|
|
2022-04-07 19:05:33 +00:00
|
|
|
UserImage {
|
2021-05-26 17:36:24 +00:00
|
|
|
id: accountImage
|
2022-04-07 19:05:33 +00:00
|
|
|
|
2021-05-26 17:36:24 +00:00
|
|
|
anchors.left: parent.left
|
2024-10-15 19:26:12 +00:00
|
|
|
anchors.leftMargin: Theme.padding
|
2021-05-26 17:36:24 +00:00
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
2022-04-07 19:05:33 +00:00
|
|
|
|
|
|
|
name: contactName
|
|
|
|
image: contactIcon
|
|
|
|
pubkey: contactPubKey
|
2021-05-26 17:36:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
StyledText {
|
|
|
|
id: usernameText
|
2022-01-04 12:06:05 +00:00
|
|
|
text: contactName
|
2021-05-26 17:36:24 +00:00
|
|
|
elide: Text.ElideRight
|
|
|
|
font.pixelSize: 17
|
|
|
|
anchors.top: accountImage.top
|
2024-10-15 19:26:12 +00:00
|
|
|
anchors.topMargin: Theme.smallPadding
|
2021-05-26 17:36:24 +00:00
|
|
|
anchors.left: accountImage.right
|
2024-10-15 19:26:12 +00:00
|
|
|
anchors.leftMargin: Theme.padding
|
2021-06-15 19:34:36 +00:00
|
|
|
anchors.right: buttons.left
|
2024-10-15 19:26:12 +00:00
|
|
|
anchors.rightMargin: Theme.padding
|
2021-05-26 17:36:24 +00:00
|
|
|
}
|
|
|
|
|
|
|
|
HoverHandler {
|
|
|
|
onHoveredChanged: container.isHovered = hovered
|
|
|
|
}
|
|
|
|
|
2021-10-01 15:58:36 +00:00
|
|
|
AcceptRejectOptionsButtonsPanel {
|
2021-06-15 19:34:36 +00:00
|
|
|
id: buttons
|
|
|
|
anchors.right: parent.right
|
2024-10-15 19:26:12 +00:00
|
|
|
anchors.rightMargin: Theme.padding
|
2021-05-26 17:36:24 +00:00
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
2021-10-01 15:58:36 +00:00
|
|
|
onAcceptClicked: container.acceptClicked()
|
|
|
|
onDeclineClicked: container.declineClicked()
|
2022-01-04 12:06:05 +00:00
|
|
|
onProfileClicked: container.openProfilePopup()
|
|
|
|
onBlockClicked: container.blockContactActionTriggered()
|
2021-05-26 17:36:24 +00:00
|
|
|
}
|
|
|
|
}
|