2024-10-15 19:26:12 +00:00
|
|
|
import QtQuick 2.15
|
2021-09-28 15:04:06 +00:00
|
|
|
|
2021-10-20 22:47:23 +00:00
|
|
|
import StatusQ.Components 0.1
|
2021-10-26 09:40:22 +00:00
|
|
|
import StatusQ.Controls 0.1
|
2024-10-25 13:00:32 +00:00
|
|
|
import StatusQ.Core 0.1
|
|
|
|
import StatusQ.Core.Theme 0.1
|
2021-10-26 09:40:22 +00:00
|
|
|
|
|
|
|
import utils 1.0
|
2024-05-22 08:13:39 +00:00
|
|
|
|
2021-10-26 09:40:22 +00:00
|
|
|
StatusListItem {
|
2022-08-16 11:12:57 +00:00
|
|
|
id: root
|
|
|
|
|
2022-03-15 15:55:18 +00:00
|
|
|
width: parent.width
|
2021-12-31 12:29:51 +00:00
|
|
|
height: visible ? implicitHeight : 0
|
2022-08-16 11:12:57 +00:00
|
|
|
title: root.name
|
2021-12-31 12:29:51 +00:00
|
|
|
|
2022-10-26 20:00:40 +00:00
|
|
|
property string name
|
|
|
|
property string iconSource
|
2024-10-25 13:00:32 +00:00
|
|
|
|
|
|
|
property color pubKeyColor
|
|
|
|
property var colorHash
|
2022-07-01 08:42:32 +00:00
|
|
|
|
2022-03-15 15:55:18 +00:00
|
|
|
property bool showSendMessageButton: false
|
2022-03-24 20:55:22 +00:00
|
|
|
property bool showRejectContactRequestButton: false
|
|
|
|
property bool showAcceptContactRequestButton: false
|
|
|
|
property bool showRemoveRejectionButton: false
|
|
|
|
property string contactText: ""
|
2022-03-15 15:55:18 +00:00
|
|
|
|
2024-10-25 15:30:48 +00:00
|
|
|
signal contextMenuRequested
|
|
|
|
signal sendMessageRequested
|
|
|
|
signal showVerificationRequestRequested
|
|
|
|
signal acceptContactRequested
|
|
|
|
signal rejectRequestRequested
|
|
|
|
signal removeRejectionRequested
|
2021-10-26 09:40:22 +00:00
|
|
|
|
2022-08-11 11:55:08 +00:00
|
|
|
asset.width: 40
|
|
|
|
asset.height: 40
|
2024-10-25 13:00:32 +00:00
|
|
|
asset.color: root.pubKeyColor
|
2022-09-22 22:18:15 +00:00
|
|
|
asset.letterSize: asset._twoLettersSize
|
2022-08-11 11:55:08 +00:00
|
|
|
asset.charactersLen: 2
|
|
|
|
asset.name: root.iconSource
|
|
|
|
asset.isLetterIdenticon: root.iconSource.toString() === ""
|
2022-07-01 08:42:32 +00:00
|
|
|
ringSettings {
|
2024-10-25 13:00:32 +00:00
|
|
|
ringSpecModel: root.colorHash
|
2022-09-21 23:48:30 +00:00
|
|
|
ringPxSize: Math.max(asset.width / 24.0)
|
2022-07-01 08:42:32 +00:00
|
|
|
}
|
|
|
|
|
2021-10-26 09:40:22 +00:00
|
|
|
components: [
|
2022-03-15 15:55:18 +00:00
|
|
|
StatusFlatRoundButton {
|
2024-10-18 13:57:07 +00:00
|
|
|
objectName: "chatBtn"
|
2022-03-15 15:55:18 +00:00
|
|
|
visible: showSendMessageButton
|
|
|
|
width: visible ? 32 : 0
|
|
|
|
height: visible ? 32 : 0
|
|
|
|
icon.name: "chat"
|
2022-05-31 12:05:40 +00:00
|
|
|
icon.color: Theme.palette.directColor1
|
2024-10-25 15:30:48 +00:00
|
|
|
onClicked: root.sendMessageRequested()
|
2022-03-15 15:55:18 +00:00
|
|
|
},
|
2022-03-24 20:55:22 +00:00
|
|
|
StatusFlatRoundButton {
|
2024-10-18 13:57:07 +00:00
|
|
|
objectName: "declineBtn"
|
2022-03-24 20:55:22 +00:00
|
|
|
visible: showRejectContactRequestButton
|
|
|
|
width: visible ? 32 : 0
|
|
|
|
height: visible ? 32 : 0
|
|
|
|
icon.name: "close-circle"
|
2024-10-15 19:26:12 +00:00
|
|
|
icon.color: Theme.palette.dangerColor1
|
2024-10-25 15:30:48 +00:00
|
|
|
onClicked: root.rejectRequestRequested()
|
2022-03-24 20:55:22 +00:00
|
|
|
},
|
|
|
|
StatusFlatRoundButton {
|
2024-10-18 13:57:07 +00:00
|
|
|
objectName: "acceptBtn"
|
2022-03-24 20:55:22 +00:00
|
|
|
visible: showAcceptContactRequestButton
|
|
|
|
width: visible ? 32 : 0
|
|
|
|
height: visible ? 32 : 0
|
|
|
|
icon.name: "checkmark-circle"
|
2024-10-15 19:26:12 +00:00
|
|
|
icon.color: Theme.palette.successColor1
|
2024-10-25 15:30:48 +00:00
|
|
|
onClicked: root.acceptContactRequested()
|
2022-03-24 20:55:22 +00:00
|
|
|
},
|
|
|
|
StatusFlatRoundButton {
|
2024-10-18 13:57:07 +00:00
|
|
|
objectName: "removeRejectBtn"
|
2022-03-24 20:55:22 +00:00
|
|
|
visible: showRemoveRejectionButton
|
|
|
|
width: visible ? 32 : 0
|
|
|
|
height: visible ? 32 : 0
|
|
|
|
icon.name: "cancel"
|
2024-10-15 19:26:12 +00:00
|
|
|
icon.color: Theme.palette.dangerColor1
|
2024-10-25 15:30:48 +00:00
|
|
|
onClicked: root.removeRejectionRequested()
|
2022-03-24 20:55:22 +00:00
|
|
|
},
|
|
|
|
StatusBaseText {
|
2022-08-16 11:12:57 +00:00
|
|
|
text: root.contactText
|
2022-03-24 20:55:22 +00:00
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
|
2024-10-25 15:30:48 +00:00
|
|
|
color: Theme.palette.baseColor1
|
2022-03-24 20:55:22 +00:00
|
|
|
},
|
2021-10-26 09:40:22 +00:00
|
|
|
StatusFlatRoundButton {
|
2024-10-18 13:57:07 +00:00
|
|
|
objectName: "moreBtn"
|
2021-10-26 09:40:22 +00:00
|
|
|
id: menuButton
|
|
|
|
width: 32
|
|
|
|
height: 32
|
|
|
|
icon.name: "more"
|
2022-05-31 12:05:40 +00:00
|
|
|
icon.color: Theme.palette.directColor1
|
2024-10-25 15:30:48 +00:00
|
|
|
onClicked: root.contextMenuRequested()
|
2020-07-24 11:27:26 +00:00
|
|
|
}
|
2021-10-26 09:40:22 +00:00
|
|
|
]
|
2020-06-13 13:49:20 +00:00
|
|
|
}
|