2021-06-15 19:34:36 +00:00
|
|
|
import QtQuick 2.13
|
|
|
|
import QtQuick.Controls 2.13
|
|
|
|
import QtQuick.Layouts 1.13
|
2021-09-28 15:04:06 +00:00
|
|
|
|
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
|
|
|
|
spacing: Style.current.halfPadding
|
|
|
|
|
|
|
|
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 {
|
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"
|
|
|
|
icon.color: Style.current.danger
|
|
|
|
backgroundHoverColor: Utils.setColorAlpha(Style.current.danger, 0.1)
|
|
|
|
onClicked: root.declineClicked()
|
2021-06-15 19:34:36 +00:00
|
|
|
}
|
|
|
|
|
2022-09-27 21:26:26 +00:00
|
|
|
StatusFlatRoundButton {
|
|
|
|
id: acceptBtn
|
|
|
|
width: 32
|
|
|
|
height: 32
|
|
|
|
anchors.verticalCenter: parent.verticalCenter
|
|
|
|
icon.name: "checkmark-circle"
|
|
|
|
icon.color: Style.current.success
|
|
|
|
backgroundHoverColor: Utils.setColorAlpha(Style.current.success, 0.1)
|
|
|
|
onClicked: root.acceptClicked()
|
|
|
|
}
|
2021-10-26 09:40:22 +00:00
|
|
|
|
|
|
|
StatusFlatRoundButton {
|
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
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|
|
|
|
}
|