1
0
mirror of https://github.com/AvengeMedia/DankMaterialShell.git synced 2026-01-29 07:52:50 -05:00

fix categories

This commit is contained in:
bbedward
2025-08-13 10:18:10 -04:00
parent e218e77380
commit 4363776545

View File

@@ -63,20 +63,17 @@ Item {
spacing: Theme.spacingS spacing: Theme.spacingS
Row { Row {
property var topRowCategories: ["All", "Development", "Graphics", "Games"] property var firstRowCategories: categories.slice(0, Math.min(4, categories.length))
width: parent.width width: parent.width
spacing: Theme.spacingS spacing: Theme.spacingS
Repeater { Repeater {
model: parent.topRowCategories.filter(cat => { model: parent.firstRowCategories
return categories.includes(cat)
})
Rectangle { Rectangle {
height: 36 height: 36
width: (parent.width - (parent.topRowCategories.length - 1) width: (parent.width - (parent.firstRowCategories.length - 1) * Theme.spacingS) / parent.firstRowCategories.length
* Theme.spacingS) / parent.topRowCategories.length
radius: Theme.cornerRadius radius: Theme.cornerRadius
color: selectedCategory === modelData ? Theme.primary : "transparent" color: selectedCategory === modelData ? Theme.primary : "transparent"
border.color: selectedCategory === modelData ? "transparent" : Qt.rgba( border.color: selectedCategory === modelData ? "transparent" : Qt.rgba(
@@ -107,21 +104,18 @@ Item {
} }
Row { Row {
property var bottomRowCategories: ["Internet", "Media", "Office", "Settings", "System"] property var secondRowCategories: categories.slice(4, categories.length)
width: parent.width width: parent.width
spacing: Theme.spacingS spacing: Theme.spacingS
visible: secondRowCategories.length > 0
Repeater { Repeater {
model: parent.bottomRowCategories.filter(cat => { model: parent.secondRowCategories
return categories.includes(
cat)
})
Rectangle { Rectangle {
height: 36 height: 36
width: (parent.width - (parent.bottomRowCategories.length - 1) width: (parent.width - (parent.secondRowCategories.length - 1) * Theme.spacingS) / parent.secondRowCategories.length
* Theme.spacingS) / parent.bottomRowCategories.length
radius: Theme.cornerRadius radius: Theme.cornerRadius
color: selectedCategory === modelData ? Theme.primary : "transparent" color: selectedCategory === modelData ? Theme.primary : "transparent"
border.color: selectedCategory === modelData ? "transparent" : Qt.rgba( border.color: selectedCategory === modelData ? "transparent" : Qt.rgba(