From c7bf7cdc0b38dfad20f39e4a721c55c5e0e7b9b7 Mon Sep 17 00:00:00 2001 From: zach Date: Mon, 17 Aug 2026 16:53:47 +0200 Subject: [PATCH] fix recursive wallpaper model in settings + clock font --- Greeter/Components/CustomTextInput.qml | 3 +- Modules/Bar/Components/Clock.qml | 4 +-- Modules/Notifications/Notification.qml | 6 +--- .../Pages/Wallpaper/WallpaperSelect.qml | 31 +++---------------- Modules/Settings/Wrapper.qml | 6 ++-- 5 files changed, 13 insertions(+), 37 deletions(-) diff --git a/Greeter/Components/CustomTextInput.qml b/Greeter/Components/CustomTextInput.qml index 2a6dcc6..42c6ead6 100644 --- a/Greeter/Components/CustomTextInput.qml +++ b/Greeter/Components/CustomTextInput.qml @@ -1,5 +1,4 @@ import QtQuick -import QtQuick.Controls import ZShell.Config import qs.Services @@ -11,6 +10,6 @@ TextInput { font { family: Config.appearance?.font.family.sans ?? "sans-serif" hintingPreference: Font.PreferFullHinting - pixelSize: Config.appearance?.font.size.normal ?? 15 + pixelSize: Tokens?.font.size.normal ?? 15 } } diff --git a/Modules/Bar/Components/Clock.qml b/Modules/Bar/Components/Clock.qml index 0125670..be0b5bd 100644 --- a/Modules/Bar/Components/Clock.qml +++ b/Modules/Bar/Components/Clock.qml @@ -114,7 +114,7 @@ WidgetBase { Layout.alignment: Qt.AlignHCenter color: root.contentColor - font: Config.appearance.font.family.mono // qmllint disable incompatible-type + font.family: Config.appearance.font.family.mono // qmllint disable incompatible-type text: { if (modelData.includes("h")) return Time.hourStr; @@ -135,7 +135,7 @@ WidgetBase { CustomText { Layout.alignment: Qt.AlignHCenter color: root.contentColor - font: Config.appearance.font.family.mono // qmllint disable incompatible-type + font.family: Config.appearance.font.family.mono // qmllint disable incompatible-type text: Qt.formatDateTime(Time.date, "AP") visible: Config.services.useTwelveHourClock && root.formatParts.timeTokens.length > 0 diff --git a/Modules/Notifications/Notification.qml b/Modules/Notifications/Notification.qml index f0ffc6a..a4ea654 100644 --- a/Modules/Notifications/Notification.qml +++ b/Modules/Notifications/Notification.qml @@ -464,11 +464,7 @@ CustomRect { enabled: root.expanded fillWidth: true - font: { - const f = Qt.font(font); - f.pointSize = Tokens.font.size.small; - return f; - } + font.pointSize: Tokens.font.size.small implicitWidth: label.implicitWidth inactiveColor: root.modelData.urgency === NotificationUrgency.Critical ? Colors.palette.m3secondary : Colors.layer(Colors.palette.m3surfaceContainerHighest, 2) inactiveOnColor: root.modelData.urgency === NotificationUrgency.Critical ? Colors.palette.m3onSecondary : Colors.palette.m3onSurfaceVariant diff --git a/Modules/Settings/Pages/Wallpaper/WallpaperSelect.qml b/Modules/Settings/Pages/Wallpaper/WallpaperSelect.qml index 8235079..c1866f7 100644 --- a/Modules/Settings/Pages/Wallpaper/WallpaperSelect.qml +++ b/Modules/Settings/Pages/Wallpaper/WallpaperSelect.qml @@ -40,40 +40,19 @@ PageBase { id: localWalls model: { - const walls = Wallpapers.list; + const walls = [...Wallpapers.list]; var baseDir = Paths.wallsdir; - const categories = {}; - const list = []; - for (const w of walls) { - var parentDir = w.parentDir; - if (!parentDir.endsWith("/")) - parentDir = parentDir + "/"; + walls.sort((a, b) => ((a.parentDir === baseDir) - (b.parentDir === baseDir)) || a.name.localeCompare(b.name)); + while (walls.length < 4) + walls.push(null); - if (!baseDir.endsWith("/")) - baseDir = baseDir + "/"; - - if (parentDir !== baseDir) { - const category = Wallpapers.getCategoryFor(w); - if (category && (!(category in categories) || categories[category].name.localeCompare(w.name) > 0)) - categories[category] = w; - } else { - list.push(w); - } - } - list.push(...Object.values(categories)); - list.sort((a, b) => ((a.parentDir === baseDir) - (b.parentDir === baseDir)) || a.name.localeCompare(b.name)); - while (list.length < 4) - list.push(null); - - return list; + return walls; } WallItem { required property FileSystemEntry modelData enabled: modelData - - // Empty placeholders for sizing opacity: modelData ? 1 : 0 source: String(modelData?.path ?? "") diff --git a/Modules/Settings/Wrapper.qml b/Modules/Settings/Wrapper.qml index 12c48ca..2c03246 100644 --- a/Modules/Settings/Wrapper.qml +++ b/Modules/Settings/Wrapper.qml @@ -1,14 +1,16 @@ +pragma ComponentBehavior: Bound + import Quickshell import QtQuick import qs.Components import ZShell.Config -import qs.Helpers Item { id: root property real offsetScale: shouldBeActive ? 0 : 1 required property var panels + property string queuedMode: "wallpaper" required property ShellScreen screen readonly property bool shouldBeActive: visibilities.settings required property PersistentProperties visibilities @@ -37,7 +39,7 @@ Item { sourceComponent: Content { sState.animatingContainer: content.opacity < 1 - sState.currentPageIdx: ["wallpaper"][0] + sState.currentPageIdx: ["wallpaper"].indexOf(root.queuedMode) sState.screen: root.screen } }