iconlaunch - Use objects instead of arrays

pull/2895/head
Martin Boonk 2023-07-25 20:43:12 +02:00
parent 7e0dbbf6f0
commit a9fff20477
1 changed files with 5 additions and 3 deletions

View File

@ -45,18 +45,20 @@
const iconYoffset = Math.floor(whitespace/4)-1;
const itemSize = iconSize + whitespace;
launchCache.items = [];
let t = Date.now();
launchCache.items = {};
for (let c of launchCache.apps){
let i = Math.floor(count/appsN);
if (!launchCache.items[i])
launchCache.items.push([]);
launchCache.items[Math.floor(count/appsN)].push(c);
launchCache.items[i] = {};
launchCache.items[i].push(count%3);
if (c.icon)
c.icondata = s.read(c.icon);
else
c.icondata = ICON_MISSING;
count++;
}
let drawItem = function(itemI, r) {
let x = 0;
let apps = launchCache.items[itemI];