Port direct chat confirmation dialog away from OverlaySheet
This commit is contained in:
@@ -354,24 +354,35 @@ Kirigami.ApplicationWindow {
|
|||||||
Component {
|
Component {
|
||||||
id: askDirectChatConfirmationComponent
|
id: askDirectChatConfirmationComponent
|
||||||
|
|
||||||
Kirigami.OverlaySheet {
|
Kirigami.Dialog {
|
||||||
id: askDirectChatConfirmation
|
id: askDirectChatConfirmation
|
||||||
|
|
||||||
required property var user
|
required property var user
|
||||||
|
|
||||||
parent: QQC2.ApplicationWindow.overlay
|
width: Math.min(Kirigami.Units.gridUnit * 24, root.width)
|
||||||
|
height: Kirigami.Units.gridUnit * 8
|
||||||
|
|
||||||
|
standardButtons: QQC2.Dialog.Close
|
||||||
title: i18n("Start a chat")
|
title: i18n("Start a chat")
|
||||||
|
|
||||||
contentItem: QQC2.Label {
|
contentItem: QQC2.Label {
|
||||||
text: i18n("Do you want to start a chat with %1?", user.displayName)
|
text: i18n("Do you want to start a chat with %1?", askDirectChatConfirmation.user.displayName)
|
||||||
wrapMode: Text.WordWrap
|
textFormat: Text.PlainText
|
||||||
|
wrapMode: Text.Wrap
|
||||||
|
horizontalAlignment: Qt.AlignHCenter
|
||||||
|
verticalAlignment: Qt.AlignVCenter
|
||||||
}
|
}
|
||||||
footer: QQC2.DialogButtonBox {
|
|
||||||
standardButtons: QQC2.DialogButtonBox.Ok | QQC2.DialogButtonBox.Cancel
|
customFooterActions: [
|
||||||
onAccepted: {
|
Kirigami.Action {
|
||||||
user.requestDirectChat();
|
text: i18nc("@action", "Start Chat")
|
||||||
askDirectChatConfirmation.close();
|
icon.name: "im-user"
|
||||||
|
onTriggered: {
|
||||||
|
askDirectChatConfirmation.user.requestDirectChat();
|
||||||
|
askDirectChatConfirmation.close();
|
||||||
|
}
|
||||||
}
|
}
|
||||||
onRejected: askDirectChatConfirmation.close()
|
]
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user