fix recursive wallpaper model in settings + clock font

This commit is contained in:
2026-08-17 16:53:47 +02:00
parent abb180c947
commit c7bf7cdc0b
5 changed files with 13 additions and 37 deletions
+1 -2
View File
@@ -1,5 +1,4 @@
import QtQuick import QtQuick
import QtQuick.Controls
import ZShell.Config import ZShell.Config
import qs.Services import qs.Services
@@ -11,6 +10,6 @@ TextInput {
font { font {
family: Config.appearance?.font.family.sans ?? "sans-serif" family: Config.appearance?.font.family.sans ?? "sans-serif"
hintingPreference: Font.PreferFullHinting hintingPreference: Font.PreferFullHinting
pixelSize: Config.appearance?.font.size.normal ?? 15 pixelSize: Tokens?.font.size.normal ?? 15
} }
} }
+2 -2
View File
@@ -114,7 +114,7 @@ WidgetBase {
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
color: root.contentColor 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: { text: {
if (modelData.includes("h")) if (modelData.includes("h"))
return Time.hourStr; return Time.hourStr;
@@ -135,7 +135,7 @@ WidgetBase {
CustomText { CustomText {
Layout.alignment: Qt.AlignHCenter Layout.alignment: Qt.AlignHCenter
color: root.contentColor 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") text: Qt.formatDateTime(Time.date, "AP")
visible: Config.services.useTwelveHourClock && root.formatParts.timeTokens.length > 0 visible: Config.services.useTwelveHourClock && root.formatParts.timeTokens.length > 0
+1 -5
View File
@@ -464,11 +464,7 @@ CustomRect {
enabled: root.expanded enabled: root.expanded
fillWidth: true fillWidth: true
font: { font.pointSize: Tokens.font.size.small
const f = Qt.font(font);
f.pointSize = Tokens.font.size.small;
return f;
}
implicitWidth: label.implicitWidth implicitWidth: label.implicitWidth
inactiveColor: root.modelData.urgency === NotificationUrgency.Critical ? Colors.palette.m3secondary : Colors.layer(Colors.palette.m3surfaceContainerHighest, 2) 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 inactiveOnColor: root.modelData.urgency === NotificationUrgency.Critical ? Colors.palette.m3onSecondary : Colors.palette.m3onSurfaceVariant
@@ -40,40 +40,19 @@ PageBase {
id: localWalls id: localWalls
model: { model: {
const walls = Wallpapers.list; const walls = [...Wallpapers.list];
var baseDir = Paths.wallsdir; var baseDir = Paths.wallsdir;
const categories = {}; walls.sort((a, b) => ((a.parentDir === baseDir) - (b.parentDir === baseDir)) || a.name.localeCompare(b.name));
const list = []; while (walls.length < 4)
for (const w of walls) { walls.push(null);
var parentDir = w.parentDir;
if (!parentDir.endsWith("/"))
parentDir = parentDir + "/";
if (!baseDir.endsWith("/")) return walls;
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;
} }
WallItem { WallItem {
required property FileSystemEntry modelData required property FileSystemEntry modelData
enabled: modelData enabled: modelData
// Empty placeholders for sizing
opacity: modelData ? 1 : 0 opacity: modelData ? 1 : 0
source: String(modelData?.path ?? "") source: String(modelData?.path ?? "")
+4 -2
View File
@@ -1,14 +1,16 @@
pragma ComponentBehavior: Bound
import Quickshell import Quickshell
import QtQuick import QtQuick
import qs.Components import qs.Components
import ZShell.Config import ZShell.Config
import qs.Helpers
Item { Item {
id: root id: root
property real offsetScale: shouldBeActive ? 0 : 1 property real offsetScale: shouldBeActive ? 0 : 1
required property var panels required property var panels
property string queuedMode: "wallpaper"
required property ShellScreen screen required property ShellScreen screen
readonly property bool shouldBeActive: visibilities.settings readonly property bool shouldBeActive: visibilities.settings
required property PersistentProperties visibilities required property PersistentProperties visibilities
@@ -37,7 +39,7 @@ Item {
sourceComponent: Content { sourceComponent: Content {
sState.animatingContainer: content.opacity < 1 sState.animatingContainer: content.opacity < 1
sState.currentPageIdx: ["wallpaper"][0] sState.currentPageIdx: ["wallpaper"].indexOf(root.queuedMode)
sState.screen: root.screen sState.screen: root.screen
} }
} }