From 377aec8f23c487007eb1834f87ff4803ebc58a0f Mon Sep 17 00:00:00 2001 From: Bea Lam Date: Tue, 7 Jan 2025 17:38:31 +1000 Subject: [PATCH] ListItem: remove spacing and bottomContentMargin properties These are no longer needed. The 'spacing' was confusing in any case because there are multiple types of spacing within ListItem. --- components/listitems/core/ListItem.qml | 2 -- components/listitems/core/ListNavigation.qml | 7 ++----- components/listitems/core/ListQuantityGroupNavigation.qml | 2 +- components/listitems/core/ListRadioButton.qml | 6 +----- components/listitems/core/ListRadioButtonGroup.qml | 1 - components/listitems/core/ListSwitch.qml | 8 ++------ components/widgets/DcLoadsWidget.qml | 5 +---- pages/settings/debug/PageDebug.qml | 5 +---- 8 files changed, 8 insertions(+), 28 deletions(-) diff --git a/components/listitems/core/ListItem.qml b/components/listitems/core/ListItem.qml index 5d9c3015d..9d7e1c4b4 100644 --- a/components/listitems/core/ListItem.qml +++ b/components/listitems/core/ListItem.qml @@ -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 diff --git a/components/listitems/core/ListNavigation.qml b/components/listitems/core/ListNavigation.qml index e5496bd01..dfd4f419d 100644 --- a/components/listitems/core/ListNavigation.qml +++ b/components/listitems/core/ListNavigation.qml @@ -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 }, @@ -45,11 +45,8 @@ ListItem { ListPressArea { id: pressArea + anchors.fill: parent.backgroundRect radius: backgroundRect.radius - anchors { - fill: parent - bottomMargin: root.spacing - } onClicked: root.clicked() } } diff --git a/components/listitems/core/ListQuantityGroupNavigation.qml b/components/listitems/core/ListQuantityGroupNavigation.qml index f7186bf4b..09466d924 100644 --- a/components/listitems/core/ListQuantityGroupNavigation.qml +++ b/components/listitems/core/ListQuantityGroupNavigation.qml @@ -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 } } diff --git a/components/listitems/core/ListRadioButton.qml b/components/listitems/core/ListRadioButton.qml index 95391126f..f342860b2 100644 --- a/components/listitems/core/ListRadioButton.qml +++ b/components/listitems/core/ListRadioButton.qml @@ -30,12 +30,8 @@ ListItem { ListPressArea { id: pressArea + anchors.fill: parent.backgroundRect radius: backgroundRect.radius - anchors { - fill: parent - bottomMargin: root.spacing - } - onClicked: root.clicked() } } diff --git a/components/listitems/core/ListRadioButtonGroup.qml b/components/listitems/core/ListRadioButtonGroup.qml index b7aaf6b1f..81b9d66d4 100644 --- a/components/listitems/core/ListRadioButtonGroup.qml +++ b/components/listitems/core/ListRadioButtonGroup.qml @@ -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 diff --git a/components/listitems/core/ListSwitch.qml b/components/listitems/core/ListSwitch.qml index a646e6dbf..873c61b74 100644 --- a/components/listitems/core/ListSwitch.qml +++ b/components/listitems/core/ListSwitch.qml @@ -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 { @@ -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) } diff --git a/components/widgets/DcLoadsWidget.qml b/components/widgets/DcLoadsWidget.qml index 805d7413f..c2627a0dc 100644 --- a/components/widgets/DcLoadsWidget.qml +++ b/components/widgets/DcLoadsWidget.qml @@ -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) } diff --git a/pages/settings/debug/PageDebug.qml b/pages/settings/debug/PageDebug.qml index 437344fbc..1df3d0a96 100644 --- a/pages/settings/debug/PageDebug.qml +++ b/pages/settings/debug/PageDebug.qml @@ -24,11 +24,8 @@ Page { } ListPressArea { + anchors.fill: switchItem.backgroundRect radius: switchItem.backgroundRect.radius - anchors { - fill: parent - bottomMargin: switchItem.spacing - } onClicked: switchItem.clicked() } }