Skip to content

Commit

Permalink
ListItem: remove spacing and bottomContentMargin properties
Browse files Browse the repository at this point in the history
These are no longer needed. The 'spacing' was confusing in any case
because there are multiple types of spacing within ListItem.
  • Loading branch information
blammit committed Jan 7, 2025
1 parent 63a1d89 commit 377aec8
Show file tree
Hide file tree
Showing 8 changed files with 8 additions and 28 deletions.
2 changes: 0 additions & 2 deletions components/listitems/core/ListItem.qml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,6 @@ Item {
property bool down
property bool flat
property alias backgroundRect: backgroundRect
property int spacing: Theme.geometry_gradientList_spacing
property int bottomContentMargin: Theme.geometry_listItem_content_spacing
property int leftPadding: flat ? Theme.geometry_listItem_flat_content_horizontalMargin : Theme.geometry_listItem_content_horizontalMargin
property int rightPadding: flat ? Theme.geometry_listItem_flat_content_horizontalMargin : Theme.geometry_listItem_content_horizontalMargin

Expand Down
7 changes: 2 additions & 5 deletions components/listitems/core/ListNavigation.qml
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ ListItem {
font.pixelSize: Theme.font_size_body2
color: Theme.color_listItem_secondaryText
wrapMode: Text.Wrap
width: Math.min(implicitWidth, root.maximumContentWidth - icon.width - parent.spacing)
width: Math.min(implicitWidth, root.maximumContentWidth - icon.width - root.content.spacing)
horizontalAlignment: Text.AlignRight
},

Expand All @@ -45,11 +45,8 @@ ListItem {
ListPressArea {
id: pressArea

anchors.fill: parent.backgroundRect
radius: backgroundRect.radius
anchors {
fill: parent
bottomMargin: root.spacing
}
onClicked: root.clicked()
}
}
2 changes: 1 addition & 1 deletion components/listitems/core/ListQuantityGroupNavigation.qml
Original file line number Diff line number Diff line change
Expand Up @@ -21,6 +21,6 @@ ListNavigation {
right: parent.right
rightMargin: Theme.geometry_listItem_content_horizontalMargin + Theme.geometry_icon_size_medium
}
height: parent.height - parent.spacing
height: parent.height - Theme.geometry_gradientList_spacing
}
}
6 changes: 1 addition & 5 deletions components/listitems/core/ListRadioButton.qml
Original file line number Diff line number Diff line change
Expand Up @@ -30,12 +30,8 @@ ListItem {
ListPressArea {
id: pressArea

anchors.fill: parent.backgroundRect
radius: backgroundRect.radius
anchors {
fill: parent
bottomMargin: root.spacing
}

onClicked: root.clicked()
}
}
1 change: 0 additions & 1 deletion components/listitems/core/ListRadioButtonGroup.qml
Original file line number Diff line number Diff line change
Expand Up @@ -116,7 +116,6 @@ ListNavigation {
C.ButtonGroup.group: radioButtonGroup

bottomContent.z: model.index === optionsListView.currentIndex ? 1 : -1
bottomContentMargin: Theme.geometry_radioButton_bottomContentMargin
bottomContentChildren: Loader {
id: bottomContentLoader

Expand Down
8 changes: 2 additions & 6 deletions components/listitems/core/ListSwitch.qml
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,7 @@ ListItem {
anchors.verticalCenter: switchItem.verticalCenter
color: Theme.color_font_secondary
font.pixelSize: Theme.font_size_body2
width: Math.min(implicitWidth, root.maximumContentWidth - switchItem.width - parent.spacing)
width: Math.min(implicitWidth, root.maximumContentWidth - switchItem.width - root.content.spacing)
wrapMode: Text.Wrap
},
Switch {
Expand All @@ -58,12 +58,8 @@ ListItem {
ListPressArea {
id: pressArea

anchors.fill: parent.backgroundRect
radius: backgroundRect.radius
anchors {
fill: parent
bottomMargin: root.spacing
}

onClicked: root._setChecked(!switchItem.checked)
}

Expand Down
5 changes: 1 addition & 4 deletions components/widgets/DcLoadsWidget.qml
Original file line number Diff line number Diff line change
Expand Up @@ -63,11 +63,8 @@ OverviewWidget {
ListPressArea {
id: delegatePressArea

anchors.fill: parent.backgroundRect
radius: backgroundRect.radius
anchors {
fill: parent
bottomMargin: deviceDelegate.spacing
}
onClicked: root._showSettingsPage(device)
}

Expand Down
5 changes: 1 addition & 4 deletions pages/settings/debug/PageDebug.qml
Original file line number Diff line number Diff line change
Expand Up @@ -24,11 +24,8 @@ Page {
}

ListPressArea {
anchors.fill: switchItem.backgroundRect
radius: switchItem.backgroundRect.radius
anchors {
fill: parent
bottomMargin: switchItem.spacing
}
onClicked: switchItem.clicked()
}
}
Expand Down

0 comments on commit 377aec8

Please sign in to comment.