Commit 93eca6ab authored by Nate Graham's avatar Nate Graham
Browse files

[Sidebar] Use leadingPadding: consistently for list items

parent f0e47fca
......@@ -145,7 +145,7 @@ Kirigami.ScrollablePage {
return delegate.ListView.view.model.rowCount(modelIndex) > 1
}
// Only indent subcategory icons in the search view
isSearching: searchField.text.length > 0
leadingPadding: (model.DepthRole > 1 && searchField.text.length > 0) ? (( model.DepthRole - 1 ) * Kirigami.Units.iconSizes.smallMedium) + Kirigami.Units.largeSpacing : 0
hoverEnabled: !model.IsCategoryRole || !mainColumn.searchMode
enabled: model.IsKCMRole || !mainColumn.searchMode
......
......@@ -15,10 +15,10 @@ Kirigami.BasicListItem {
property bool selected: delegate.highlighted || delegate.pressed
property bool isSearching: false
// Dummy item to make leadingPadding value manipulable by clients
leading: Item {
width: (model.DepthRole > 1 && delegate.isSearching) ? (( model.DepthRole - 1 ) * Kirigami.Units.iconSizes.smallMedium) + Kirigami.Units.largeSpacing : 0
width: 0
}
// We are manipulating the padding in the leading item itself, so set this to 0
leadingPadding: 0
icon: model.decoration
......
......@@ -141,6 +141,7 @@ Kirigami.ScrollablePage {
delegate: CategoryItem {
id: delegate
// Indent items that are children of other KCMs within the same group
leadingPadding: model.DepthRole > 2 ? (( model.DepthRole - 2 ) * Kirigami.Units.iconSizes.smallMedium) + Kirigami.Units.largeSpacing : 0
onClicked: {
......
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