Settings window #20

Merged
Zacharias-Brohn merged 83 commits from settingsWindow into main 2026-03-06 23:27:24 +01:00
2 changed files with 101 additions and 92 deletions
Showing only changes of commit f645c90dbd - Show all commits
+97 -91
View File
@@ -12,10 +12,78 @@ import qs.Helpers
Item { Item {
id: root id: root
ListModel {
id: listModel
ListElement {
name: "General"
icon: "settings"
}
ListElement {
name: "Wallpaper"
icon: "wallpaper"
}
ListElement {
name: "Bar"
icon: "settop_component"
}
ListElement {
name: "Lockscreen"
icon: "lock"
}
ListElement {
name: "Services"
icon: "build_circle"
}
ListElement {
name: "Notifications"
icon: "notifications"
}
ListElement {
name: "Sidebar"
icon: "view_sidebar"
}
ListElement {
name: "Utilities"
icon: "handyman"
}
ListElement {
name: "Dashboard"
icon: "dashboard"
}
ListElement {
name: "Appearance"
icon: "colors"
}
ListElement {
name: "On screen display"
icon: "display_settings"
}
ListElement {
name: "Launcher"
icon: "rocket_launch"
}
ListElement {
name: "Colors"
icon: "colors"
}
}
required property Item content required property Item content
implicitWidth: clayout.implicitWidth + Appearance.padding.smaller * 2 implicitWidth: clayout.contentWidth + Appearance.padding.smaller * 2
implicitHeight: clayout.implicitHeight + Appearance.padding.smaller * 2 implicitHeight: clayout.contentHeight + Appearance.padding.smaller * 2
CustomRect { CustomRect {
@@ -24,103 +92,37 @@ Item {
color: DynamicColors.tPalette.m3surfaceContainer color: DynamicColors.tPalette.m3surfaceContainer
radius: 4 radius: 4
ColumnLayout { CustomListView {
id: clayout id: clayout
anchors.centerIn: parent
model: listModel
contentWidth: contentItem.childrenRect.width
contentHeight: contentItem.childrenRect.height
implicitWidth: contentItem.childrenRect.width
implicitHeight: contentItem.childrenRect.height
spacing: 5 spacing: 5
anchors.centerIn: parent highlight: CustomRect {
color: DynamicColors.palette.m3primary
radius: 4
Category { y: clayout.currentItem?.y ?? 0
name: "General" implicitWidth: clayout.width
icon: "settings" implicitHeight: clayout.currentItem?.implicitHeight ?? 0
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter Behavior on y {
} Anim {
duration: Appearance.anim.durations.small
Category { easing.bezierCurve: Appearance.anim.curves.expressiveEffects
name: "Wallpaper" }
icon: "wallpaper" }
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
} }
Category { highlightFollowsCurrentItem: false
name: "Bar"
icon: "settop_component"
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
}
Category { delegate: Category {}
name: "Lockscreen"
icon: "lock"
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
}
Category {
name: "Services"
icon: "build_circle"
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
}
Category {
name: "Notifications"
icon: "notifications"
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
}
Category {
name: "Sidebar"
icon: "view_sidebar"
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
}
Category {
name: "Utilities"
icon: "handyman"
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
}
Category {
name: "Dashboard"
icon: "dashboard"
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
}
Category {
name: "Appearance"
icon: "colors"
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
}
Category {
name: "On screen display"
icon: "display_settings"
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
}
Category {
name: "Launcher"
icon: "rocket_launch"
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
}
Category {
name: "Colors"
icon: "colors"
Layout.fillWidth: true
Layout.alignment: Qt.AlignHCenter
}
} }
} }
@@ -129,6 +131,7 @@ Item {
required property string name required property string name
required property string icon required property string icon
required property int index
implicitWidth: 200 implicitWidth: 200
implicitHeight: 42 implicitHeight: 42
@@ -146,6 +149,7 @@ Item {
id: icon id: icon
text: categoryItem.icon text: categoryItem.icon
color: categoryItem.index === clayout.currentIndex ? DynamicColors.palette.m3onPrimary : DynamicColors.palette.m3onSurface
font.pointSize: 22 font.pointSize: 22
Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter
Layout.preferredWidth: icon.contentWidth Layout.preferredWidth: icon.contentWidth
@@ -157,6 +161,7 @@ Item {
id: text id: text
text: categoryItem.name text: categoryItem.name
color: categoryItem.index === clayout.currentIndex ? DynamicColors.palette.m3onPrimary : DynamicColors.palette.m3onSurface
Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter Layout.alignment: Qt.AlignLeft | Qt.AlignVCenter
Layout.fillWidth: true Layout.fillWidth: true
Layout.fillHeight: true Layout.fillHeight: true
@@ -170,6 +175,7 @@ Item {
onClicked: { onClicked: {
root.content.currentCategory = categoryItem.name.toLowerCase(); root.content.currentCategory = categoryItem.name.toLowerCase();
clayout.currentIndex = categoryItem.index;
} }
} }
} }
+4 -1
View File
@@ -31,6 +31,9 @@ RowLayout {
Layout.alignment: Qt.AlignRight Layout.alignment: Qt.AlignRight
checked: root.setting checked: root.setting
onToggled: root.setting = checked onToggled: {
root.setting = checked;
Config.save();
}
} }
} }