This is standard for KDE dialogs, but we weren't super consistent about it. Most of this is porting to DialogButtonBox, and using buttonRole. I also made sure the close button is hidden in cases where we have a cancel button already. I also took the time to clean out some cruft like manually calling close() and such. I probably missed a lot more spots, but this is a good improvement.
34 lines
1007 B
QML
34 lines
1007 B
QML
// SPDX-FileCopyrightText: 2024 Tobias Fella <tobias.fella@kde.org>
|
|
// SPDX-License-Identifier: GPL-2.0-or-later
|
|
|
|
import QtQuick
|
|
import QtQuick.Controls as QQC2
|
|
|
|
import org.kde.kirigami as Kirigami
|
|
|
|
import org.kde.neochat
|
|
|
|
Kirigami.PromptDialog {
|
|
id: root
|
|
|
|
required property NeoChatRoom room
|
|
|
|
title: root.room.isSpace ? i18nc("@title:dialog", "Confirm Leaving Space") : i18nc("@title:dialog", "Confirm Leaving Room")
|
|
subtitle: root.room ? i18nc("Do you really want to leave <room name>?", "Do you really want to leave %1?", root.room.displayNameForHtml) : ""
|
|
dialogType: Kirigami.PromptDialog.Warning
|
|
standardButtons: QQC2.Dialog.Cancel
|
|
|
|
onAccepted: root.room.forget()
|
|
|
|
footer: QQC2.DialogButtonBox {
|
|
QQC2.Button {
|
|
text: i18nc("@action:button Leave this room/space", "Leave")
|
|
icon.name: "arrow-left-symbolic"
|
|
|
|
onClicked: root.accept()
|
|
|
|
QQC2.DialogButtonBox.buttonRole: QQC2.DialogButtonBox.AcceptRole
|
|
}
|
|
}
|
|
}
|