From f23192156866093a1d4a7f0a5e75dc0b27d0fc5d Mon Sep 17 00:00:00 2001
From: 2 * r + 2 * t <61896496+soramanew@users.noreply.github.com>
Date: Sat, 5 Apr 2025 14:26:26 +1100
Subject: launcher: optimise wallpaper selector
Optimise thumbnail size
Also limit number shown
Add show all when no search option
---
src/config/defaults.ts | 2 ++
src/config/types.ts | 2 ++
src/modules/launcher/actions.tsx | 42 ++++++++++++++++++++---------
src/services/wallpapers.ts | 17 ++++++++++--
src/utils/thumbnailer.ts | 58 +++++++++++++++++++++++++---------------
5 files changed, 84 insertions(+), 37 deletions(-)
diff --git a/src/config/defaults.ts b/src/config/defaults.ts
index 763ccc2..ac56c13 100644
--- a/src/config/defaults.ts
+++ b/src/config/defaults.ts
@@ -68,6 +68,8 @@ export default {
notify: true,
},
wallpaper: {
+ maxResults: 20, // Actual max results, -1 for infinite
+ showAllEmpty: true, // Show all wallpapers when search is empty
style: "medium", // One of "compact", "medium", "large"
},
disabledActions: ["logout", "shutdown", "reboot", "hibernate"], // Actions to hide, see launcher/actions.tsx for available actions
diff --git a/src/config/types.ts b/src/config/types.ts
index 0d875ce..a311f88 100644
--- a/src/config/types.ts
+++ b/src/config/types.ts
@@ -44,6 +44,8 @@ export default {
"launcher.files.shortenThreshold": NUM,
"launcher.math.maxResults": NUM,
"launcher.todo.notify": BOOL,
+ "launcher.wallpaper.maxResults": NUM,
+ "launcher.wallpaper.showAllEmpty": BOOL,
"launcher.wallpaper.style": ["compact", "medium", "large"],
"launcher.disabledActions": ARR(STR),
// Notif popups
diff --git a/src/modules/launcher/actions.tsx b/src/modules/launcher/actions.tsx
index 64f475a..04c5458 100644
--- a/src/modules/launcher/actions.tsx
+++ b/src/modules/launcher/actions.tsx
@@ -287,7 +287,7 @@ const Scheme = ({ scheme, name, colours }: { scheme?: string; name: string; colo
);
};
-const Wallpaper = ({ path, thumbnail }: IWallpaper) => (
+const Wallpaper = ({ path, thumbnails }: IWallpaper) => (
);
+const CategoryThumbnail = ({ style, wallpapers }: { style: string; wallpapers: IWallpaper[] }) => (
+
+ {wallpapers.slice(0, 3).map(w => (
+
+ ))}
+
+);
+
const Category = ({ path, wallpapers }: ICategory) => (