Commit 90cbd408 authored by Nate Graham's avatar Nate Graham
Browse files

[Sidebar view] Only indent subsategory icons in the search view

They were always being indented even outside of the search view, which
was not the intention. Indenting was only supposed to be done in the
search view to communicate the parent/child relationship of categories
and their items.
parent 46d05391
...@@ -184,6 +184,8 @@ Kirigami.ScrollablePage { ...@@ -184,6 +184,8 @@ Kirigami.ScrollablePage {
contentItem: CategoryItem { contentItem: CategoryItem {
showArrow: model.IsCategoryRole showArrow: model.IsCategoryRole
selected: delegate.highlighted || delegate.pressed selected: delegate.highlighted || delegate.pressed
// Only indent subcategory icons in the search view
isSearching: searchField.text.length > 0
} }
} }
} }
......
...@@ -8,6 +8,7 @@ RowLayout { ...@@ -8,6 +8,7 @@ RowLayout {
property bool showArrow: false property bool showArrow: false
property bool selected: false property bool selected: false
property bool isSearching: false
spacing: Kirigami.Settings.tabletMode ? Kirigami.Units.largeSpacing : Kirigami.Units.smallSpacing spacing: Kirigami.Settings.tabletMode ? Kirigami.Units.largeSpacing : Kirigami.Units.smallSpacing
Kirigami.Icon { Kirigami.Icon {
...@@ -15,7 +16,7 @@ RowLayout { ...@@ -15,7 +16,7 @@ RowLayout {
source: model.decoration source: model.decoration
Layout.preferredHeight: Layout.preferredWidth Layout.preferredHeight: Layout.preferredWidth
Layout.preferredWidth: Kirigami.Units.iconSizes.smallMedium Layout.preferredWidth: Kirigami.Units.iconSizes.smallMedium
Layout.leftMargin: model.DepthRole > 1 ? (model.DepthRole - 1) * (Kirigami.Units.iconSizes.smallMedium + layout.spacing) : 0 Layout.leftMargin: model.DepthRole > 1 && layout.isSearching ? (model.DepthRole - 1) * (Kirigami.Units.iconSizes.smallMedium + layout.spacing) : 0
} }
QQC2.Label { QQC2.Label {
Layout.fillWidth: true Layout.fillWidth: true
......
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