Skip to content

Commit 8f49fdb

Browse files
committed
fix: allow non category walls in nexus wall select
1 parent 36adb25 commit 8f49fdb

1 file changed

Lines changed: 8 additions & 4 deletions

File tree

modules/nexus/pages/wallandstyle/WallpaperSelect.qml

Lines changed: 8 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -102,17 +102,21 @@ PageBase {
102102
const walls = Wallpapers.list;
103103
const baseDir = Paths.wallsdir;
104104
const categories = {};
105+
const list = [];
105106
for (const w of walls) {
106107
if (w.parentDir !== baseDir) {
107108
const category = Wallpapers.getCategoryFor(w);
108109
if (category && (!(category in categories) || categories[category].name.localeCompare(w.name) > 0))
109110
categories[category] = w;
111+
} else {
112+
list.push(w);
110113
}
111114
}
112-
const cats = Object.values(categories);
113-
while (cats.length < Config.nexus.wallpapersPerRow)
114-
cats.push(null);
115-
return cats;
115+
list.push(...Object.values(categories));
116+
list.sort((a, b) => ((a.parentDir === baseDir) - (b.parentDir === baseDir)) || a.name.localeCompare(b.name));
117+
while (list.length < Config.nexus.wallpapersPerRow)
118+
list.push(null);
119+
return list;
116120
}
117121

118122
WallItem {

0 commit comments

Comments
 (0)