Commit afec6b29 authored by Nate Graham's avatar Nate Graham 💤
Browse files

[Sidebar view] Add arrow to list items which are parent/category items

That's what Discover displays for list items which go to a sub-page when
clicked, which I think is a nice touch and provides visual clarity for
the user.

This commit implements the same thing for the System Settings sidebar
view's custom' list items.
parent 62aa94c0
......@@ -181,7 +181,10 @@ Kirigami.ScrollablePage {
highlighted: categoryView.currentIndex == index
Keys.onEnterPressed: clicked();
Keys.onReturnPressed: clicked();
contentItem: CategoryItem {}
contentItem: CategoryItem {
showArrow: model.IsCategoryRole
selected: delegate.highlighted || delegate.pressed
}
}
}
......
......@@ -5,6 +5,10 @@ import org.kde.kirigami 2.10 as Kirigami
RowLayout {
id: layout
property bool showArrow: false
property bool selected: false
spacing: Kirigami.Settings.tabletMode ? Kirigami.Units.largeSpacing : Kirigami.Units.smallSpacing
Kirigami.Icon {
id: icon
......@@ -20,6 +24,18 @@ RowLayout {
elide: Text.ElideRight
}
Kirigami.Icon {
Layout.alignment: Qt.AlignVCenter
Layout.preferredHeight: Kirigami.Units.iconSizes.small
// This is to vertically align the defaults indicators when visible
Layout.rightMargin: systemsettings.defaultsIndicatorsVisible && !defaultIndicator.visible ? defaultIndicator.implicitWidth + layout.spacing : 0
opacity: 0.7
Layout.preferredWidth: Layout.preferredHeight
source: (LayoutMirroring.enabled ? "go-next-symbolic-rtl" : "go-next-symbolic")
visible: layout.showArrow
selected: layout.selected
}
Rectangle {
id: defaultIndicator
radius: width * 0.5
......
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