status-desktop/ui/imports/shared/panels/AcceptRejectOptionsButtonsP...

90 lines
2.3 KiB
QML
Raw Normal View History

import QtQuick 2.15
import QtQuick.Controls 2.15
import QtQuick.Layouts 1.15
import StatusQ.Core.Theme 0.1
import StatusQ.Controls 0.1
import StatusQ.Popups 0.1
import utils 1.0
import shared.controls.chat.menuItems 1.0
Row {
id: root
2022-09-27 21:26:26 +00:00
height: declineBtn.height
spacing: Theme.halfPadding
2022-09-27 21:26:26 +00:00
property alias menuButton: menuButton
signal acceptClicked()
signal declineClicked()
signal blockClicked()
signal profileClicked()
signal detailsClicked()
StatusFlatRoundButton {
objectName: "declineBtn"
id: declineBtn
width: 32
height: 32
anchors.verticalCenter: parent.verticalCenter
icon.name: "close-circle"
icon.color: Theme.palette.dangerColor1
backgroundHoverColor: Utils.setColorAlpha(Theme.palette.dangerColor1, 0.1)
onClicked: root.declineClicked()
}
2022-09-27 21:26:26 +00:00
StatusFlatRoundButton {
objectName: "acceptBtn"
2022-09-27 21:26:26 +00:00
id: acceptBtn
width: 32
height: 32
anchors.verticalCenter: parent.verticalCenter
icon.name: "checkmark-circle"
icon.color: Theme.palette.successColor1
backgroundHoverColor: Utils.setColorAlpha(Theme.palette.successColor1, 0.1)
2022-09-27 21:26:26 +00:00
onClicked: root.acceptClicked()
}
StatusFlatRoundButton {
objectName: "moreBtn"
id: menuButton
anchors.verticalCenter: parent.verticalCenter
width: 32
height: 32
icon.name: "more"
type: StatusFlatRoundButton.Type.Secondary
onClicked: {
highlighted = true
contactContextMenu.popup(-contactContextMenu.width+menuButton.width, menuButton.height + 4)
}
2022-12-01 16:58:37 +00:00
StatusMenu {
id: contactContextMenu
onClosed: {
menuButton.highlighted = false
}
ViewProfileMenuItem {
onTriggered: root.profileClicked()
}
StatusAction {
text: qsTr("Details")
icon.name: "info"
onTriggered: root.detailsClicked()
}
StatusMenuSeparator {}
2022-12-01 16:58:37 +00:00
StatusAction {
text: qsTr("Decline and block")
icon.name: "cancel"
2022-12-01 16:58:37 +00:00
type: StatusAction.Type.Danger
onTriggered: root.blockClicked()
}
}
}
}