Just don't call Bangle.loadWidgets in your clock and you won't get them.
In terms of moving them, the biggest issue is whether the app itself is aware that they have moved, but if you're writing the app then there's no problem :)
If you want to render them all down the left-hand side of the watch screen you can just add this to your watch face:
Bangle.drawWidgets = (function() {
if (global.WIDGETS) {
var y=0, maxw=0;
for (var wd of WIDGETS) {
wd.x = 0;
wd.y = y;
y += 24;
maxw = Math.max(wd.width, maxw);
}
g.reset();
g.clearRect(0,0,maxw-1,g.getHeight()-1);
try { for (wd of WIDGETS) wd.draw(wd); } catch(e) {print(e);}
}
})
I guess there's also the question of widget width since they can all be varying widths, and it is possible to rotate all the widgets too - you just have to override each widget's draw function so it renders to a buffer which you then rotate.
Bangle.drawWidgets = (function() {
if (global.WIDGETS) {
var y=0;
for (var wd of WIDGETS) {
wd.x = 0;
wd.y = y;
y += wd.width;
}
g.reset().clearRect(0,0,23,g.getHeight()-1);
try { for (wd of WIDGETS) wd.draw(wd); } catch(e) {print(e);}
}
});
Bangle.loadWidgets();
Object.keys(WIDGETS).forEach(k => {
var wd = WIDGETS[k];
wd._draw = wd.draw;
wd.draw = function() {
if (!wd.width) return;
var og = g, oy=wd.y;
g = Graphics.createArrayBuffer(24,wd.width,16,{msb:true});
g._reset = g.reset;
g.reset = () => g._reset().setColor(og.theme.fg).setBgColor(og.theme.bg);
g.setRotation(1).setBgColor(og.theme.bg).clear();
wd.y = 0;
wd._draw(wd);
wd.y = oy;
og.drawImage(g,0,wd.y);
g = og;
};
});
Bangle.drawWidgets();
Espruino is a JavaScript interpreter for low-power Microcontrollers. This site is both a support community for Espruino and a place to share what you are working on.
Just don't call
Bangle.loadWidgets
in your clock and you won't get them.In terms of moving them, the biggest issue is whether the app itself is aware that they have moved, but if you're writing the app then there's no problem :)
So... This is what the current drawWidgets function looks like: https://github.com/espruino/Espruino/blob/master/libs/js/banglejs/Bangle_drawWidgets_Q3.js
If you want to render them all down the left-hand side of the watch screen you can just add this to your watch face:
I guess there's also the question of widget width since they can all be varying widths, and it is possible to rotate all the widgets too - you just have to override each widget's draw function so it renders to a buffer which you then rotate.