[kcm/kwinrules] Fix layout misalignment of list items

Summary:
Remove anchors within `Kirigami.AbstractListItem` delegates.
They were causing random misalignment of items in the main and the overlay `ListView`s

Test Plan:
Before {F8284332}
After {F8284333}

Reviewers: broulik, #vdg, #kwin, ngraham

Reviewed By: #vdg, ngraham

Subscribers: ahiemstra, ngraham, kwin

Tags: #kwin

Differential Revision: https://phabricator.kde.org/D29423
This commit is contained in:
Ismael Asensio 2020-05-04 22:00:44 +02:00
parent 760765ed52
commit 471554b7a3
2 changed files with 2 additions and 9 deletions

View file

@ -35,11 +35,6 @@ Kirigami.AbstractListItem {
hoverEnabled: false
RowLayout {
anchors {
left: parent.left
right: parent.right
margins: Kirigami.Units.smallSpacing
}
Kirigami.Icon {
id: itemIcon

View file

@ -143,14 +143,10 @@ ScrollViewKCM {
width: ListView.view.width
RowLayout {
anchors.fill: parent
Kirigami.Icon {
source: model.icon
Layout.preferredHeight: Kirigami.Units.iconSizes.smallMedium
Layout.preferredWidth: Kirigami.Units.iconSizes.smallMedium
Layout.leftMargin: Kirigami.Units.largeSpacing
Layout.rightMargin: Kirigami.Units.largeSpacing
Layout.alignment: Qt.AlignVCenter
}
QQC2.Label {
@ -183,6 +179,8 @@ ScrollViewKCM {
opacity: propertyDelegate.hovered ? 1 : 0
onClicked: propertyDelegate.clicked()
Layout.preferredWidth: implicitWidth
Layout.leftMargin: -Kirigami.Units.smallSpacing
Layout.rightMargin: -Kirigami.Units.smallSpacing
Layout.alignment: Qt.AlignVCenter
}
}