Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion apps/gridlaunch/ChangeLog
Original file line number Diff line number Diff line change
@@ -1 +1,2 @@
0.01: New app
0.01: New app
0.02: Fix last row not showing apps
15 changes: 5 additions & 10 deletions apps/gridlaunch/app.js
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@

let s = require("Storage");
let settings = Object.assign(
{showClocks:false,showLaunchers:false, showWidgets:true},s.readJSON("gridlaunch.settings.json")||{});
Expand All @@ -16,25 +15,24 @@ if(settings.showWidgets){
}
E.showScroller({
h : 70,
c : chunkedApps.length-1,
c : chunkedApps.length,
draw : (idx, r) => {
if (!chunkedApps[idx]) return;

const iconW = 43;
const iconW = 48*0.9;
const third = r.w / 3;
const x0 = r.x + (third * 0.5) - (iconW / 2);
const x1 = r.x + (third * 1.5) - (iconW / 2);
const x2 = r.x + (third * 2.5) - (iconW / 2);

// 2. Strict checks ensure s.read() is only executed if BOTH the app and icon exist
if (chunkedApps[idx][0] && chunkedApps[idx][0].icon) {
g.drawImage(s.read(chunkedApps[idx][0].icon), x0, r.y, {scale:0.9});
g.drawImage(s.read(chunkedApps[idx][0].icon), x0, r.y-3, {scale:0.9});
}
if (chunkedApps[idx][1] && chunkedApps[idx][1].icon) {
g.drawImage(s.read(chunkedApps[idx][1].icon), x1, r.y+26, {scale:0.9});
}
if (chunkedApps[idx][2] && chunkedApps[idx][2].icon) {
g.drawImage(s.read(chunkedApps[idx][2].icon), x2, r.y, {scale:0.9});
g.drawImage(s.read(chunkedApps[idx][2].icon), x2, r.y-3, {scale:0.9});
}
},
select : (idx, touch) => {
Expand All @@ -49,12 +47,9 @@ E.showScroller({
if (!app.src || s.read(app.src)===undefined) {
E.showScroller();
E.showMessage(/*LANG*/"App Source\nNot found");
setTimeout(drawMenu, 2000);
} else {
require("launch_utils").loadApp(app);
}
},
back : Bangle.showClock,
});


});
2 changes: 1 addition & 1 deletion apps/gridlaunch/metadata.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@
"id": "gridlaunch",
"name": "Grid Launcher",
"shortName": "Grid Launch",
"version": "0.01",
"version": "0.02",
"author": "RKBoss6",
"description": "A simple grid launcher in a familiar style",
"icon": "icon.png",
Expand Down
Loading