Commit 56529e7b authored by Kevin Ottens's avatar Kevin Ottens
Browse files

Remove Kirigami DelegateRecycler

Summary:
This is not really needed here due to the size of the delegates and of
the list which is generally short. I ended up getting rid of it because
it makes this config module crash somewhere in the QML runtime when the
user clicks reset. I couldn't track down why DelegateRecycler does this
so far.

Reviewers: #plasma, mart, davidedmundson, crossi, bport

Subscribers: plasma-devel

Tags: #plasma

Differential Revision: https://phabricator.kde.org/D26241
parent 4dca72bd
......@@ -178,58 +178,63 @@ ScrollViewKCM {
Component {
id: languagesListItemComponent
Kirigami.SwipeListItem {
id: listItem
contentItem: RowLayout {
Kirigami.ListItemDragHandle {
listItem: listItem
listView: languagesList
onMoveRequested: kcm.selectedTranslationsModel.move(oldIndex, newIndex)
}
Item {
width: ListView.view.width
height: listItem.implicitHeight
Kirigami.SwipeListItem {
id: listItem
contentItem: RowLayout {
Kirigami.ListItemDragHandle {
listItem: listItem
listView: languagesList
onMoveRequested: kcm.selectedTranslationsModel.move(oldIndex, newIndex)
}
Kirigami.Icon {
visible: model.IsMissing
Kirigami.Icon {
visible: model.IsMissing
Layout.alignment: Qt.AlignVCenter
Layout.alignment: Qt.AlignVCenter
width: Kirigami.Units.iconSizes.smallMedium
height: width
width: Kirigami.Units.iconSizes.smallMedium
height: width
source: "error"
color: Kirigami.Theme.negativeTextColor
}
source: "error"
color: Kirigami.Theme.negativeTextColor
}
QtControls.Label {
Layout.fillWidth: true
QtControls.Label {
Layout.fillWidth: true
Layout.alignment: Qt.AlignVCenter
Layout.alignment: Qt.AlignVCenter
text: (index == 0) ? i18nc("@item:inlistbox 1 = Language name", "%1 (Default)", model.display) : model.display
text: (index == 0) ? i18nc("@item:inlistbox 1 = Language name", "%1 (Default)", model.display) : model.display
color: (model.IsMissing ? Kirigami.Theme.negativeTextColor
: (listItem.checked || (listItem.pressed && !listItem.checked && !listItem.sectionDelegate)
? listItem.activeTextColor : listItem.textColor))
color: (model.IsMissing ? Kirigami.Theme.negativeTextColor
: (listItem.checked || (listItem.pressed && !listItem.checked && !listItem.sectionDelegate)
? listItem.activeTextColor : listItem.textColor))
}
}
}
actions: [
Kirigami.Action {
enabled: !model.IsMissing && index > 0
iconName: "go-top"
tooltip: i18nc("@info:tooltip", "Promote to default")
onTriggered: kcm.selectedTranslationsModel.move(index, 0)
},
Kirigami.Action {
property bool removing: false
enabled: removing || !model.IsMissing && languagesList.count > 1
iconName: "list-remove"
tooltip: i18nc("@info:tooltip", "Remove")
onTriggered: {
removing = true; // Don't crash by re-evaluating `enabled` during destruction.
kcm.selectedTranslationsModel.remove(model.LanguageCode);
}
}]
actions: [
Kirigami.Action {
enabled: !model.IsMissing && index > 0
iconName: "go-top"
tooltip: i18nc("@info:tooltip", "Promote to default")
onTriggered: kcm.selectedTranslationsModel.move(index, 0)
},
Kirigami.Action {
property bool removing: false
enabled: removing || !model.IsMissing && languagesList.count > 1
iconName: "list-remove"
tooltip: i18nc("@info:tooltip", "Remove")
onTriggered: {
removing = true; // Don't crash by re-evaluating `enabled` during destruction.
kcm.selectedTranslationsModel.remove(model.LanguageCode);
}
}]
}
}
}
......@@ -237,12 +242,7 @@ ScrollViewKCM {
id: languagesList
model: kcm.selectedTranslationsModel
delegate: Kirigami.DelegateRecycler {
width: languagesList.width
sourceComponent: languagesListItemComponent
}
delegate: languagesListItemComponent
}
footer: RowLayout {
......
Markdown is supported
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