Ensure most of our dialogs have cancel buttons on the right
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.
This commit is contained in:
@@ -19,22 +19,12 @@ Kirigami.Dialog {
|
||||
|
||||
required property NeoChatRoom room
|
||||
|
||||
standardButtons: Kirigami.Dialog.Cancel
|
||||
|
||||
customFooterActions: [
|
||||
Kirigami.Action {
|
||||
enabled: optionModel.allValuesSet && questionTextField.text.length > 0
|
||||
text: i18nc("@action:button", "Send")
|
||||
icon.name: "document-send"
|
||||
onTriggered: {
|
||||
root.room.postPoll(pollTypeCombo.currentValue, questionTextField.text, optionModel.values())
|
||||
root.close()
|
||||
}
|
||||
}
|
||||
]
|
||||
|
||||
width: Math.min(QQC2.ApplicationWindow.window.width, Kirigami.Units.gridUnit * 24)
|
||||
title: i18nc("@title: create new poll in the room", "Create Poll")
|
||||
showCloseButton: false
|
||||
standardButtons: QQC2.Dialog.Cancel
|
||||
|
||||
onAccepted: root.room.postPoll(pollTypeCombo.currentValue, questionTextField.text, optionModel.values())
|
||||
|
||||
contentItem: ColumnLayout {
|
||||
spacing: 0
|
||||
@@ -148,4 +138,16 @@ Kirigami.Dialog {
|
||||
onClicked: optionModel.append({optionText: ""})
|
||||
}
|
||||
}
|
||||
|
||||
footer: QQC2.DialogButtonBox {
|
||||
QQC2.Button {
|
||||
enabled: optionModel.allValuesSet && questionTextField.text.length > 0
|
||||
text: i18nc("@action:button", "Send")
|
||||
icon.name: "document-send"
|
||||
|
||||
onClicked: root.accept()
|
||||
|
||||
QQC2.DialogButtonBox.buttonRole: QQC2.DialogButtonBox.AcceptRole
|
||||
}
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user