Skip to content
GitLab
Menu
Projects
Groups
Snippets
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in
Toggle navigation
Menu
Open sidebar
Plasma
System Settings
Commits
93eca6ab
Commit
93eca6ab
authored
Apr 22, 2021
by
Nate Graham
Browse files
[Sidebar] Use leadingPadding: consistently for list items
parent
f0e47fca
Changes
3
Hide whitespace changes
Inline
Side-by-side
sidebar/package/contents/ui/CategoriesPage.qml
View file @
93eca6ab
...
...
@@ -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
...
...
sidebar/package/contents/ui/CategoryItem.qml
View file @
93eca6ab
...
...
@@ -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
...
...
sidebar/package/contents/ui/SubCategoryPage.qml
View file @
93eca6ab
...
...
@@ -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
:
{
...
...
Write
Preview
Supports
Markdown
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment