Commit 5d0c9551 authored by Arjen Hiemstra's avatar Arjen Hiemstra
Browse files

Remove RowLayout from KillDialog DialogButtonBox

RowLayout does something which will trigger a crash when the
dialogbuttonbox gets destroyed. So instead use the normal layout,
calculate the fill width for the checkbox manually. Also remove the
workaround for QTBUG-81796 since that was fixed in the meantime.

BUG: 435192


(cherry picked from commit 79d28437)
parent f151d1a1
......@@ -75,15 +75,14 @@ Dialog {
footer: DialogButtonBox {
id: buttonBox
contentWidth: availableWidth
contentItem: RowLayout {
Repeater {
model: buttonBox.contentModel
}
}
CheckBox {
Layout.fillWidth: true
width: buttonBox.width - acceptButton.width - cancelButton.width - buttonBox.spacing * 2 - buttonBox.leftPadding - buttonBox.rightPadding
anchors.verticalCenter: parent.verticalCenter
contentItem: Label {
anchors.verticalCenter: parent.verticalCenter
leftPadding: Kirigami.Units.gridUnit + Kirigami.Units.smallSpacing;
text: i18ndc("plasma-systemmonitor", "@option:check", "Do not ask again");
wrapMode: Text.WordWrap
......@@ -92,27 +91,15 @@ Dialog {
onToggled: dialog.doNotAskAgain = checked
}
Button {
implicitWidth: contentItem.implicitWidth + Kirigami.Units.largeSpacing * 2
contentItem: RowLayout {
anchors.fill: parent
anchors.leftMargin: Kirigami.Units.largeSpacing
anchors.rightMargin: Kirigami.Units.largeSpacing
//Workaround for QTBUG-81796
Kirigami.Icon { source: dialog.killButtonIcon; Layout.preferredWidth: Kirigami.Units.iconSizes.smallMedium}
Label { text: dialog.killButtonText }
}
id: acceptButton
icon.name: dialog.killButtonIcon
text: dialog.killButtonText
DialogButtonBox.buttonRole: DialogButtonBox.AcceptRole
}
Button {
implicitWidth: contentItem.implicitWidth + Kirigami.Units.largeSpacing * 2
contentItem: RowLayout {
anchors.fill: parent
anchors.leftMargin: Kirigami.Units.largeSpacing
anchors.rightMargin: Kirigami.Units.largeSpacing
//Workaround for QTBUG-81796
Kirigami.Icon { source: "dialog-cancel"; Layout.preferredWidth: Kirigami.Units.iconSizes.smallMedium}
Label { text: i18ndc("plasma-systemmonitor", "@action:button", "Cancel") }
}
id: cancelButton
icon.name: "dialog-cancel"
text: i18ndc("plasma-systemmonitor", "@action:button", "Cancel")
DialogButtonBox.buttonRole: DialogButtonBox.RejectRole
}
}
......
Supports Markdown
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment