Files
z-bar-qt/Modules/Settings/Pages/Wallpaper/WallpaperSelect.qml
T
zach 9edbcbd610
C++ / fmt (pull_request) Failing after 11s
C++ / build (pull_request) Failing after 14s
C++ / clang-tidy (pull_request) Failing after 9s
JS/TS / fmt (pull_request) Successful in 10s
JS/TS / lint (pull_request) Successful in 8s
Python / static (pull_request) Failing after 28s
Rust / build (pull_request) Successful in 47s
Python / verify (pull_request) Failing after 1m20s
Rust / fmt (pull_request) Successful in 28s
Rust / clippy (pull_request) Successful in 59s
feat: skip two-way copy for cuda devices when decoding video wallpapers + cache wallpapers as blobs in new database
2026-10-26 02:51:28 +01:00

101 lines
2.1 KiB
QML

pragma ComponentBehavior: Bound
import QtQuick
import QtQuick.Layouts
import ZShell.Models
import qs.Paths
import qs.Helpers
import qs.Components
import ZShell.Config
import qs.Modules.Settings.Common
import qs.Services
PageBase {
id: root
isSubPage: true
title: qsTr("Wallpapers")
ColumnLayout {
anchors.left: parent.left
anchors.right: parent.right
anchors.top: parent.top
spacing: Tokens.spacing.small
width: root.cappedWidth
CustomText {
Layout.topMargin: Tokens.spacing.largeIncreased
font: Tokens.font.title.small
text: qsTr("Wallpapers")
}
GridLayout {
Layout.fillWidth: true
columnSpacing: Tokens.spacing.extraSmall
columns: 4
rowSpacing: Tokens.spacing.extraSmall
visible: localWalls.count > 0
Repeater {
id: localWalls
model: {
const walls = [...Wallpapers.list];
var baseDir = Paths.wallsdir;
walls.sort((a, b) => ((a.parentDir === baseDir) - (b.parentDir === baseDir)) || a.name.localeCompare(b.name));
while (walls.length < 4)
walls.push(null);
return walls;
}
WallItem {
id: wallItem
required property WallpaperEntry modelData
enabled: modelData
opacity: modelData ? 1 : 0
source: String(modelData?.thumbnailPath ?? "")
onClicked: {
Wallpapers.setWallpaper(modelData.path);
root.sState.closeSubPage();
}
}
}
}
Loader {
Layout.fillWidth: true
active: localWalls.count === 0
asynchronous: true
visible: active
sourceComponent: CustomRect {
color: Colors.tPalette.m3surfaceContainer
implicitHeight: noWallsLayout.implicitHeight + Tokens.padding.extraLarge * 3
radius: Tokens.rounding.largeIncreased
ColumnLayout {
id: noWallsLayout
anchors.centerIn: parent
spacing: Tokens.spacing.extraSmall
MaterialIcon {
Layout.alignment: Qt.AlignHCenter
color: Colors.palette.m3outline
text: "hide_image"
}
CustomText {
Layout.alignment: Qt.AlignHCenter
color: Colors.palette.m3outline
text: qsTr("No local wallpapers found")
}
}
}
}
}
}