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
|
|
|
|
2024-10-15 19:26:12 +00:00
|
|
|
import StatusQ.Core.Theme 0.1
|
2021-10-18 10:34:16 +00:00
|
|
|
import StatusQ.Controls 0.1
|
2021-10-26 09:40:22 +00:00
|
|
|
import StatusQ.Popups 0.1
|
2021-10-18 10:34:16 +00:00
|
|
|
|
2021-10-26 09:40:22 +00:00
|
|
|
import utils 1.0
|
2022-06-10 11:12:03 +00:00
|
|
|
import shared.controls.chat.menuItems 1.0
|
2021-06-15 19:34:36 +00:00
|
|
|
|
|
|
|
Row {
|
2022-09-27 16:21:00 +00:00
|
|
|
id: root
|
2022-09-27 21:26:26 +00:00
|
|
|
height: declineBtn.height
|
2024-10-15 19:26:12 +00:00
|
|
|
spacing: Theme.halfPadding
|
2022-09-27 21:26:26 +00:00
|
|
|
|
|
|
|
property alias menuButton: menuButton
|
2022-09-27 16:21:00 +00:00
|
|
|
|
2021-06-15 19:34:36 +00:00
|
|
|
signal acceptClicked()
|
|
|
|
signal declineClicked()
|
|
|
|
signal blockClicked()
|
|
|
|
signal profileClicked()
|
2022-12-05 15:37:21 +00:00
|
|
|
signal detailsClicked()
|
2021-06-15 19:34:36 +00:00
|
|
|
|
2021-10-18 10:34:16 +00:00
|
|
|
StatusFlatRoundButton {
|
2024-10-18 13:57:07 +00:00
|
|
|
objectName: "declineBtn"
|
2021-06-15 19:34:36 +00:00
|
|
|
id: declineBtn
|
|
|
|
width: 32
|
|
|
|
height: 32
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
2021-10-18 10:34:16 +00:00
|
|
|
icon.name: "close-circle"
|
2024-10-15 19:26:12 +00:00
|
|
|
icon.color: Theme.palette.dangerColor1
|
|
|
|
backgroundHoverColor: Utils.setColorAlpha(Theme.palette.dangerColor1, 0.1)
|
2021-10-18 10:34:16 +00:00
|
|
|
onClicked: root.declineClicked()
|
2021-06-15 19:34:36 +00:00
|
|
|
}
|
|
|
|
|
2022-09-27 21:26:26 +00:00
|
|
|
StatusFlatRoundButton {
|
2024-10-18 13:57:07 +00:00
|
|
|
objectName: "acceptBtn"
|
2022-09-27 21:26:26 +00:00
|
|
|
id: acceptBtn
|
|
|
|
width: 32
|
|
|
|
height: 32
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
icon.name: "checkmark-circle"
|
2024-10-15 19:26:12 +00:00
|
|
|
icon.color: Theme.palette.successColor1
|
|
|
|
backgroundHoverColor: Utils.setColorAlpha(Theme.palette.successColor1, 0.1)
|
2022-09-27 21:26:26 +00:00
|
|
|
onClicked: root.acceptClicked()
|
|
|
|
}
|
2021-10-26 09:40:22 +00:00
|
|
|
|
|
|
|
StatusFlatRoundButton {
|
2024-10-18 13:57:07 +00:00
|
|
|
objectName: "moreBtn"
|
2021-06-15 19:34:36 +00:00
|
|
|
id: menuButton
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
2021-10-26 09:40:22 +00:00
|
|
|
width: 32
|
|
|
|
height: 32
|
|
|
|
icon.name: "more"
|
|
|
|
type: StatusFlatRoundButton.Type.Secondary
|
|
|
|
onClicked: {
|
|
|
|
highlighted = true
|
|
|
|
contactContextMenu.popup(-contactContextMenu.width+menuButton.width, menuButton.height + 4)
|
|
|
|
}
|
2021-07-09 11:47:21 +00:00
|
|
|
|
2022-12-01 16:58:37 +00:00
|
|
|
StatusMenu {
|
2021-10-26 09:40:22 +00:00
|
|
|
id: contactContextMenu
|
2021-06-15 19:34:36 +00:00
|
|
|
|
2021-10-26 09:40:22 +00:00
|
|
|
onClosed: {
|
|
|
|
menuButton.highlighted = false
|
2021-06-15 19:34:36 +00:00
|
|
|
}
|
|
|
|
|
2022-06-10 11:12:03 +00:00
|
|
|
ViewProfileMenuItem {
|
2021-07-09 11:47:21 +00:00
|
|
|
onTriggered: root.profileClicked()
|
|
|
|
}
|
2021-10-26 09:40:22 +00:00
|
|
|
|
2022-12-05 15:37:21 +00:00
|
|
|
StatusAction {
|
|
|
|
text: qsTr("Details")
|
|
|
|
icon.name: "info"
|
|
|
|
onTriggered: root.detailsClicked()
|
|
|
|
}
|
|
|
|
|
2021-10-26 09:40:22 +00:00
|
|
|
StatusMenuSeparator {}
|
|
|
|
|
2022-12-01 16:58:37 +00:00
|
|
|
StatusAction {
|
2021-10-26 09:40:22 +00:00
|
|
|
text: qsTr("Decline and block")
|
|
|
|
icon.name: "cancel"
|
2022-12-01 16:58:37 +00:00
|
|
|
type: StatusAction.Type.Danger
|
2021-07-09 11:47:21 +00:00
|
|
|
onTriggered: root.blockClicked()
|
2021-06-15 19:34:36 +00:00
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|