settings window category navrail changes and padding decreases
Lint & Format (JS/TS) / lint-format (pull_request) Successful in 13s
Python / lint-format (pull_request) Successful in 20s
Python / test (pull_request) Successful in 28s
Lint & Format (Rust) / lint-format (pull_request) Successful in 1m8s

This commit is contained in:
2026-06-09 13:09:31 +02:00
parent 6bab341190
commit dbccc14f9a
3 changed files with 198 additions and 72 deletions
+196 -70
View File
@@ -18,8 +18,22 @@ Item {
// Function to select category by key // Function to select category by key
function selectCategory(categoryKey: string) { function selectCategory(categoryKey: string) {
for (let i = 0; i < listModel.count; i++) { for (let i = 0; i < appearanceCats.count; i++) {
if (listModel.get(i).key === categoryKey) { if (appearanceCats.get(i).key === categoryKey) {
clayout.currentIndex = i;
root.content.currentCategory = categoryKey;
return;
}
}
for (let i = 0; i < systemCats.count; i++) {
if (systemCats.get(i).key === categoryKey) {
clayout.currentIndex = i;
root.content.currentCategory = categoryKey;
return;
}
}
for (let i = 0; i < panelCats.count; i++) {
if (panelCats.get(i).key === categoryKey) {
clayout.currentIndex = i; clayout.currentIndex = i;
root.content.currentCategory = categoryKey; root.content.currentCategory = categoryKey;
return; return;
@@ -27,17 +41,11 @@ Item {
} }
} }
implicitHeight: searchBar.implicitHeight + Appearance.spacing.smaller + clayout.contentHeight + Appearance.padding.smaller * 2 implicitHeight: searchBar.implicitHeight + Appearance.spacing.smaller + clayout.contentHeight + clayout.anchors.margins * 2
implicitWidth: clayout.contentWidth + Appearance.padding.smaller * 2 implicitWidth: clayout.contentWidth + clayout.anchors.margins * 2
ListModel { ListModel {
id: listModel id: appearanceCats
ListElement {
icon: "settings"
key: "general"
name: "General"
}
ListElement { ListElement {
icon: "wallpaper" icon: "wallpaper"
@@ -46,15 +54,25 @@ Item {
} }
ListElement { ListElement {
icon: "settop_component" icon: "screenshot_region"
key: "bar" key: "screenshot"
name: "Bar" name: "Screenshot"
} }
ListElement { ListElement {
icon: "lock" icon: "colors"
key: "lockscreen" key: "appearance"
name: "Lockscreen" name: "Appearance"
}
}
ListModel {
id: systemCats
ListElement {
icon: "settings"
key: "general"
name: "General"
} }
ListElement { ListElement {
@@ -69,12 +87,6 @@ Item {
name: "Notifications" name: "Notifications"
} }
ListElement {
icon: "view_sidebar"
key: "sidebar"
name: "Sidebar"
}
ListElement { ListElement {
icon: "handyman" icon: "handyman"
key: "utilities" key: "utilities"
@@ -82,15 +94,37 @@ Item {
} }
ListElement { ListElement {
icon: "dashboard" icon: "cached"
key: "dashboard" key: "updates"
name: "Dashboard" name: "Updates"
}
}
ListModel {
id: panelCats
ListElement {
icon: "settop_component"
key: "bar"
name: "Bar"
} }
ListElement { ListElement {
icon: "colors" icon: "lock"
key: "appearance" key: "lockscreen"
name: "Appearance" name: "Lockscreen"
}
ListElement {
icon: "view_sidebar"
key: "sidebar"
name: "Sidebar"
}
ListElement {
icon: "dashboard"
key: "dashboard"
name: "Dashboard"
} }
ListElement { ListElement {
@@ -104,18 +138,6 @@ Item {
key: "launcher" key: "launcher"
name: "Launcher" name: "Launcher"
} }
ListElement {
icon: "screenshot_region"
key: "screenshot"
name: "Screenshot"
}
ListElement {
icon: "cached"
key: "updates"
name: "Updates"
}
} }
CustomClippingRect { CustomClippingRect {
@@ -123,34 +145,112 @@ Item {
color: DynamicColors.tPalette.m3surfaceContainer color: DynamicColors.tPalette.m3surfaceContainer
radius: Appearance.rounding.normal radius: Appearance.rounding.normal
CustomListView { Flickable {
id: clayout id: clayout
anchors.bottom: parent.bottom anchors.fill: parent
anchors.horizontalCenter: parent.horizontalCenter anchors.margins: Appearance.padding.extraSmall
anchors.margins: Appearance.padding.smaller
anchors.top: parent.top
boundsBehavior: Flickable.StopAtBounds
contentWidth: contentItem.childrenRect.width contentWidth: contentItem.childrenRect.width
highlightFollowsCurrentItem: false flickableDirection: Flickable.VerticalFlick
implicitWidth: contentItem.childrenRect.width
model: listModel
spacing: 5
delegate: Category { ColumnLayout {
} anchors.horizontalCenter: parent.horizontalCenter
highlight: CustomRect { anchors.top: parent.top
color: DynamicColors.palette.m3primary spacing: Appearance.spacing.normal
implicitHeight: clayout.currentItem?.implicitHeight ?? 0
implicitWidth: clayout.width
radius: Appearance.rounding.normal - Appearance.padding.smaller
y: clayout.currentItem?.y ?? 0
Behavior on y { CustomListView {
Anim { id: sysView
duration: Appearance.anim.durations.small
easing.bezierCurve: Appearance.anim.curves.expressiveEffects Layout.fillWidth: true
Layout.preferredHeight: contentItem.childrenRect.height
Layout.preferredWidth: contentItem.childrenRect.width
boundsBehavior: Flickable.StopAtBounds
highlightFollowsCurrentItem: false
interactive: false
model: systemCats
spacing: 2
delegate: Category {
view: sysView
} }
// highlight: CustomRect {
// color: DynamicColors.palette.m3primary
// implicitHeight: sysView.currentItem?.implicitHeight ?? 0
// implicitWidth: sysView.width
// radius: Appearance.rounding.normal - Appearance.padding.smaller
// y: sysView.currentItem?.y ?? 0
//
// Behavior on y {
// Anim {
// duration: Appearance.anim.durations.small
// easing.bezierCurve: Appearance.anim.curves.expressiveEffects
// }
// }
// }
}
CustomListView {
id: panelsView
Layout.fillWidth: true
Layout.preferredHeight: contentItem.childrenRect.height
Layout.preferredWidth: contentItem.childrenRect.width
boundsBehavior: Flickable.StopAtBounds
contentWidth: contentItem.childrenRect.width
highlightFollowsCurrentItem: false
interactive: false
model: panelCats
spacing: 2
delegate: Category {
view: panelsView
}
// highlight: CustomRect {
// color: DynamicColors.palette.m3primary
// implicitHeight: panelsView.currentItem?.implicitHeight ?? 0
// implicitWidth: panelsView.width
// radius: Appearance.rounding.normal - Appearance.padding.smaller
// y: panelsView.currentItem?.y ?? 0
//
// Behavior on y {
// Anim {
// duration: Appearance.anim.durations.small
// easing.bezierCurve: Appearance.anim.curves.expressiveEffects
// }
// }
// }
}
CustomListView {
id: appearanceView
Layout.fillWidth: true
Layout.preferredHeight: contentItem.childrenRect.height
Layout.preferredWidth: contentItem.childrenRect.width
boundsBehavior: Flickable.StopAtBounds
contentWidth: contentItem.childrenRect.width
highlightFollowsCurrentItem: false
interactive: false
model: appearanceCats
spacing: 2
delegate: Category {
view: appearanceView
}
// highlight: CustomRect {
// color: DynamicColors.palette.m3primary
// implicitHeight: appearanceView.currentItem?.implicitHeight ?? 0
// implicitWidth: appearanceView.width
// radius: Appearance.rounding.normal - Appearance.padding.smaller
// y: appearanceView.currentItem?.y ?? 0
//
// Behavior on y {
// Anim {
// duration: Appearance.anim.durations.small
// easing.bezierCurve: Appearance.anim.curves.expressiveEffects
// }
// }
// }
} }
} }
} }
@@ -163,10 +263,36 @@ Item {
required property int index required property int index
required property string key required property string key
required property string name required property string name
required property ListView view
bottomLeftRadius: key === root.content.currentCategory || index === view.model.count - 1 ? (layer.pressed ? (Appearance.rounding.extraSmall / 2) : Appearance.rounding.normal - clayout.anchors.margins) : (layer.pressed ? (Appearance.rounding.extraSmall / 2) : Appearance.rounding.extraSmall)
bottomRightRadius: key === root.content.currentCategory || index === view.model.count - 1 ? (layer.pressed ? (Appearance.rounding.extraSmall / 2) : Appearance.rounding.normal - clayout.anchors.margins) : (layer.pressed ? (Appearance.rounding.extraSmall / 2) : Appearance.rounding.extraSmall)
color: key === root.content.currentCategory ? DynamicColors.palette.m3primary : DynamicColors.tPalette.m3surfaceContainer
implicitHeight: 42 implicitHeight: 42
implicitWidth: 250 implicitWidth: 256
radius: Appearance.rounding.normal - Appearance.padding.smaller topLeftRadius: key === root.content.currentCategory || index === 0 ? (layer.pressed ? (Appearance.rounding.extraSmall / 2) : Appearance.rounding.normal - clayout.anchors.margins) : (layer.pressed ? (Appearance.rounding.extraSmall / 2) : Appearance.rounding.extraSmall)
topRightRadius: key === root.content.currentCategory || index === 0 ? (layer.pressed ? (Appearance.rounding.extraSmall / 2) : Appearance.rounding.normal - clayout.anchors.margins) : (layer.pressed ? (Appearance.rounding.extraSmall / 2) : Appearance.rounding.extraSmall)
Behavior on bottomLeftRadius {
Anim {
type: Anim.FastEffects
}
}
Behavior on bottomRightRadius {
Anim {
type: Anim.FastEffects
}
}
Behavior on topLeftRadius {
Anim {
type: Anim.FastEffects
}
}
Behavior on topRightRadius {
Anim {
type: Anim.FastEffects
}
}
RowLayout { RowLayout {
id: layout id: layout
@@ -182,8 +308,8 @@ Item {
Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter
Layout.fillHeight: true Layout.fillHeight: true
Layout.preferredWidth: icon.contentWidth Layout.preferredWidth: icon.contentWidth
color: categoryItem.index === clayout.currentIndex ? DynamicColors.palette.m3onPrimary : DynamicColors.palette.m3onSurface color: categoryItem.key === root.content.currentCategory ? DynamicColors.palette.m3onPrimary : DynamicColors.palette.m3onSurface
fill: categoryItem.index === clayout.currentIndex ? 1 : 0 fill: categoryItem.key === root.content.currentCategory ? 1 : 0
font.pointSize: Appearance.font.size.small * 2 font.pointSize: Appearance.font.size.small * 2
text: categoryItem.icon text: categoryItem.icon
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
@@ -201,7 +327,7 @@ Item {
Layout.fillHeight: true Layout.fillHeight: true
Layout.fillWidth: true Layout.fillWidth: true
Layout.leftMargin: Appearance.spacing.normal Layout.leftMargin: Appearance.spacing.normal
color: categoryItem.index === clayout.currentIndex ? DynamicColors.palette.m3onPrimary : DynamicColors.palette.m3onSurface color: categoryItem.key === root.content.currentCategory ? DynamicColors.palette.m3onPrimary : DynamicColors.palette.m3onSurface
text: categoryItem.name text: categoryItem.name
verticalAlignment: Text.AlignVCenter verticalAlignment: Text.AlignVCenter
} }
@@ -210,11 +336,11 @@ Item {
StateLayer { StateLayer {
id: layer id: layer
color: categoryItem.index === clayout.currentIndex ? DynamicColors.palette.m3onPrimary : DynamicColors.palette.m3onSurface color: categoryItem.key === root.content.currentCategory ? DynamicColors.palette.m3onPrimary : DynamicColors.palette.m3onSurface
onClicked: { onClicked: {
root.content.currentCategory = categoryItem.key; root.content.currentCategory = categoryItem.key;
clayout.currentIndex = categoryItem.index; categoryItem.view.currentIndex = categoryItem.index;
} }
} }
} }
+1 -1
View File
@@ -141,7 +141,7 @@ Item {
id: stack id: stack
anchors.fill: parent anchors.fill: parent
anchors.margins: Appearance.padding.smaller anchors.margins: Appearance.padding.extraSmall
initialItem: general initialItem: general
} }
} }
+1 -1
View File
@@ -27,7 +27,7 @@ CustomClippingRect {
return false; return false;
} }
radius: Appearance.rounding.normal - Appearance.padding.smaller radius: Appearance.rounding.normal - Appearance.padding.extraSmall
CustomFlickable { CustomFlickable {
id: flickable id: flickable