feat: add no local walls placeholder

This commit is contained in:
2 * r + 2 * t 2026-06-06 16:16:56 +10:00
parent e238fee4a5
commit b5d6d857e0

View file

@ -89,12 +89,15 @@ PageBase {
GridLayout { GridLayout {
Layout.fillWidth: true Layout.fillWidth: true
visible: localWalls.count > 0
columns: Config.nexus.wallpapersPerRow columns: Config.nexus.wallpapersPerRow
rowSpacing: Tokens.spacing.medium rowSpacing: Tokens.spacing.medium
columnSpacing: Tokens.spacing.large columnSpacing: Tokens.spacing.large
Repeater { Repeater {
id: localWalls
model: { model: {
const walls = Wallpapers.list; const walls = Wallpapers.list;
const baseDir = Paths.wallsdir; const baseDir = Paths.wallsdir;
@ -132,5 +135,40 @@ PageBase {
} }
} }
} }
Loader {
Layout.fillWidth: true
asynchronous: true
active: localWalls.count === 0
visible: active
sourceComponent: StyledRect {
color: Colours.tPalette.m3surfaceContainer
radius: Tokens.rounding.extraLarge
implicitHeight: noWallsLayout.implicitHeight + Tokens.padding.extraExtraLarge * 2
ColumnLayout {
id: noWallsLayout
anchors.centerIn: parent
spacing: Tokens.spacing.extraSmall
MaterialIcon {
Layout.alignment: Qt.AlignHCenter
text: "hide_image"
color: Colours.palette.m3outline
fontStyle: Tokens.font.icon.extraLarge
}
StyledText {
Layout.alignment: Qt.AlignHCenter
text: qsTr("No local wallpapers found")
color: Colours.palette.m3outline
font: Tokens.font.title.small
}
}
}
}
} }
} }