Commit b1148de1 authored by David Redondo's avatar David Redondo 🏎
Browse files

Fix some visual bugs of the KillDialog

- padding between icon and separator by using standard delegates instead of custom ones
- proper button icon sizes, the icons are in a layout and should not specify their size
- add a bit more padding between checkbox and its label
- wrap the checkbox text by using a RowLayout as contentItem of the footer
BUG: 433751
parent 20426cca
......@@ -237,26 +237,11 @@ Faces.SensorFace {
items: table.selectedApplications
delegate: Kirigami.AbstractListItem {
leftPadding: Kirigami.Units.gridUnit
contentItem: RowLayout {
spacing: Kirigami.Units.largeSpacing
Kirigami.Icon {
Layout.preferredWidth: Kirigami.Units.iconSizes.large;
Layout.preferredHeight: width;
source: modelData.iconName
}
ColumnLayout {
id: detailsColumn
Label { Layout.fillWidth: true; text: modelData.name; elide: Text.ElideRight }
Label {
Layout.fillWidth: true
text: i18ncp("@item:intable", "%1 Process", "%1 Processes", modelData.pids.length)
color: Kirigami.Theme.disabledTextColor
elide: Text.ElideRight
}
}
}
delegate: Kirigami.BasicListItem {
icon: modelData.iconName
iconSize: Kirigami.Units.iconSizes.large
label: modelData.name
subtitle: i18ncp("@item:intable", "%1 Process", "%1 Processes", modelData.pids.length)
highlighted: false
hoverEnabled: false
}
......
......@@ -227,17 +227,9 @@ Faces.SensorFace {
items: table.selectedProcesses
delegate: Kirigami.AbstractListItem {
leftPadding: Kirigami.Units.gridUnit
contentItem: Column {
Label { text: modelData.name; width: parent.width; elide: Text.ElideRight }
Label {
width: parent.width
text: i18nc("@item:intable %1 is process id, %2 is user name", "Process ID %1, owned by %2", modelData.pid, modelData.username)
color: Kirigami.Theme.disabledTextColor
elide: Text.ElideRight
}
}
delegate: Kirigami.BasicListItem {
label: modelData.name
subtitle: i18nc("@item:intable %1 is process id, %2 is user name", "Process ID %1, owned by %2", modelData.pid, modelData.username)
highlighted: false
hoverEnabled: false
}
......
......@@ -53,7 +53,9 @@ Dialog {
header: Label {
id: questionLabel
padding: Kirigami.Units.gridUnit
width: parent.width
text: dialog.questionText
wrapMode: Text.Wrap
}
model: dialog.items
......@@ -72,11 +74,22 @@ Dialog {
}
footer: DialogButtonBox {
id: buttonBox
contentWidth: availableWidth
contentItem: RowLayout {
Repeater {
model: buttonBox.contentModel
}
}
CheckBox {
implicitWidth: contentItem.implicitWidth + Kirigami.Units.smallSpacing * 2
contentItem: Label { leftPadding: Kirigami.Units.gridUnit; text: i18ndc("plasma-systemmonitor", "@option:check", "Do not ask again") }
implicitHeight: contentItem.implicitHeight
Layout.fillWidth: true
contentItem: Label {
leftPadding: Kirigami.Units.gridUnit + Kirigami.Units.smallSpacing;
text: i18ndc("plasma-systemmonitor", "@option:check", "Do not ask again");
wrapMode: Text.WordWrap
}
DialogButtonBox.buttonRole: DialogButtonBox.ActionRole
onToggled: dialog.doNotAskAgain = checked
}
Button {
......@@ -86,7 +99,7 @@ Dialog {
anchors.leftMargin: Kirigami.Units.largeSpacing
anchors.rightMargin: Kirigami.Units.largeSpacing
//Workaround for QTBUG-81796
Kirigami.Icon { source: dialog.killButtonIcon; width: Kirigami.Units.iconSizes.smallMedium; height: width }
Kirigami.Icon { source: dialog.killButtonIcon; Layout.preferredWidth: Kirigami.Units.iconSizes.smallMedium}
Label { text: dialog.killButtonText }
}
DialogButtonBox.buttonRole: DialogButtonBox.AcceptRole
......@@ -98,7 +111,7 @@ Dialog {
anchors.leftMargin: Kirigami.Units.largeSpacing
anchors.rightMargin: Kirigami.Units.largeSpacing
//Workaround for QTBUG-81796
Kirigami.Icon { source: "dialog-cancel"; width: Kirigami.Units.iconSizes.smallMedium; height: width }
Kirigami.Icon { source: "dialog-cancel"; Layout.preferredWidth: Kirigami.Units.iconSizes.smallMedium}
Label { 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