mirror of https://github.com/espruino/BangleApps
set widget sortorder through code for widpa,widpb,widbata,widlock
parent
7102061614
commit
c4946c7a3c
|
@ -1,2 +1,3 @@
|
||||||
0.01: Created
|
0.01: Created
|
||||||
0.02: Set sort order to -10 so always display in right hand corner
|
0.02: Set sort order to -10 so always display in right hand corner
|
||||||
|
0.03: Set sort order from the code
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
"shortName":"Battery Theme",
|
"shortName":"Battery Theme",
|
||||||
"icon": "widbata.png",
|
"icon": "widbata.png",
|
||||||
"screenshots": [{"url":"screenshot_widbata_1.png"}],
|
"screenshots": [{"url":"screenshot_widbata_1.png"}],
|
||||||
"version":"0.02",
|
"version":"0.03",
|
||||||
"type": "widget",
|
"type": "widget",
|
||||||
"supports": ["BANGLEJS", "BANGLEJS2"],
|
"supports": ["BANGLEJS", "BANGLEJS2"],
|
||||||
"readme": "README.md",
|
"readme": "README.md",
|
||||||
|
|
|
@ -2,7 +2,7 @@ setInterval(()=>WIDGETS["bata"].draw(), 60000);
|
||||||
Bangle.on('lcdPower', function(on) {
|
Bangle.on('lcdPower', function(on) {
|
||||||
if (on) WIDGETS["bata"].draw();
|
if (on) WIDGETS["bata"].draw();
|
||||||
});
|
});
|
||||||
WIDGETS["bata"]={area:"tr",width:27,draw:function() {
|
WIDGETS["bata"]={area:"tr",sortorder:-10,width:27,draw:function() {
|
||||||
var s = 26;
|
var s = 26;
|
||||||
var t = 13; // thickness
|
var t = 13; // thickness
|
||||||
var x = this.x, y = this.y;
|
var x = this.x, y = this.y;
|
||||||
|
|
|
@ -3,3 +3,4 @@
|
||||||
0.03: Don't try to be fancy - just bail out on firmwares without a lock event
|
0.03: Don't try to be fancy - just bail out on firmwares without a lock event
|
||||||
0.04: Set sortorder to -1 so that widget always takes up the furthest left position
|
0.04: Set sortorder to -1 so that widget always takes up the furthest left position
|
||||||
0.05: Set sortorder to -10 so that others can take -1 etc
|
0.05: Set sortorder to -10 so that others can take -1 etc
|
||||||
|
0.06: Set sortorder to -10 in widget code
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"id": "widlock",
|
"id": "widlock",
|
||||||
"name": "Lock Widget",
|
"name": "Lock Widget",
|
||||||
"version": "0.05",
|
"version": "0.06",
|
||||||
"description": "On devices with always-on display (Bangle.js 2) this displays lock icon whenever the display is locked",
|
"description": "On devices with always-on display (Bangle.js 2) this displays lock icon whenever the display is locked",
|
||||||
"icon": "widget.png",
|
"icon": "widget.png",
|
||||||
"type": "widget",
|
"type": "widget",
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
WIDGETS["lock"].width = Bangle.isLocked()?16:0;
|
WIDGETS["lock"].width = Bangle.isLocked()?16:0;
|
||||||
Bangle.drawWidgets();
|
Bangle.drawWidgets();
|
||||||
});
|
});
|
||||||
WIDGETS["lock"]={area:"tl",width:Bangle.isLocked()?16:0,draw:function(w) {
|
WIDGETS["lock"]={area:"tl",sortorder:-10,width:Bangle.isLocked()?16:0,draw:function(w) {
|
||||||
if (Bangle.isLocked())
|
if (Bangle.isLocked())
|
||||||
g.reset().drawImage(atob("DhABH+D/wwMMDDAwwMf/v//4f+H/h/8//P/z///f/g=="), w.x+1, w.y+4);
|
g.reset().drawImage(atob("DhABH+D/wwMMDDAwwMf/v//4f+H/h/8//P/z///f/g=="), w.x+1, w.y+4);
|
||||||
}};
|
}};
|
||||||
|
|
|
@ -1,3 +1,4 @@
|
||||||
0.01: First release
|
0.01: First release
|
||||||
0.02: Size widget after step count is reset
|
0.02: Size widget after step count is reset
|
||||||
0.03: set sortorder to -1
|
0.03: set sortorder to -1
|
||||||
|
0.04: set sortorder through code
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
"shortName":"Simple Pedometer",
|
"shortName":"Simple Pedometer",
|
||||||
"icon": "screenshot_widpa.png",
|
"icon": "screenshot_widpa.png",
|
||||||
"screenshots": [{"url":"screenshot_widpa.png"}],
|
"screenshots": [{"url":"screenshot_widpa.png"}],
|
||||||
"version":"0.03",
|
"version":"0.04",
|
||||||
"type": "widget",
|
"type": "widget",
|
||||||
"supports": ["BANGLEJS", "BANGLEJS2"],
|
"supports": ["BANGLEJS", "BANGLEJS2"],
|
||||||
"readme": "README.md",
|
"readme": "README.md",
|
||||||
|
|
|
@ -2,7 +2,7 @@ Bangle.on('step', function(s) { WIDGETS["widpa"].draw(); });
|
||||||
Bangle.on('lcdPower', function(on) {
|
Bangle.on('lcdPower', function(on) {
|
||||||
if (on) WIDGETS["widpa"].draw();
|
if (on) WIDGETS["widpa"].draw();
|
||||||
});
|
});
|
||||||
WIDGETS["widpa"]={area:"tl",width:13,draw:function() {
|
WIDGETS["widpa"]={area:"tl",sortorder:-1,width:13,draw:function() {
|
||||||
if (!Bangle.isLCDOn()) return; // dont redraw if LCD is off
|
if (!Bangle.isLCDOn()) return; // dont redraw if LCD is off
|
||||||
var steps = Bangle.getHealthStatus("day").steps;
|
var steps = Bangle.getHealthStatus("day").steps;
|
||||||
var w = 1 + (steps.toString().length)*12;
|
var w = 1 + (steps.toString().length)*12;
|
||||||
|
|
|
@ -2,3 +2,4 @@
|
||||||
0.02: Fixed widget id to wibpb, Size widget after step count is reset
|
0.02: Fixed widget id to wibpb, Size widget after step count is reset
|
||||||
0.03: Fixed widget id in onStep() come on get it right!
|
0.03: Fixed widget id in onStep() come on get it right!
|
||||||
0.04: set sortorder to -1
|
0.04: set sortorder to -1
|
||||||
|
0.05: set sortorder through code
|
||||||
|
|
|
@ -4,7 +4,7 @@
|
||||||
"shortName":"Lato Pedometer",
|
"shortName":"Lato Pedometer",
|
||||||
"icon": "screenshot_widpb.png",
|
"icon": "screenshot_widpb.png",
|
||||||
"screenshots": [{"url":"screenshot_widpb.png"}],
|
"screenshots": [{"url":"screenshot_widpb.png"}],
|
||||||
"version":"0.04",
|
"version":"0.05",
|
||||||
"type": "widget",
|
"type": "widget",
|
||||||
"supports": ["BANGLEJS", "BANGLEJS2"],
|
"supports": ["BANGLEJS", "BANGLEJS2"],
|
||||||
"readme": "README.md",
|
"readme": "README.md",
|
||||||
|
|
|
@ -3,7 +3,7 @@ Bangle.on('step', function(s) { WIDGETS["widpb"].draw(); });
|
||||||
Bangle.on('lcdPower', function(on) {
|
Bangle.on('lcdPower', function(on) {
|
||||||
if (on) WIDGETS["widpb"].draw();
|
if (on) WIDGETS["widpb"].draw();
|
||||||
});
|
});
|
||||||
WIDGETS["widpb"]={area:"tl",width:13,draw:function() {
|
WIDGETS["widpb"]={area:"tl",sortorder:-1,width:13,draw:function() {
|
||||||
if (!Bangle.isLCDOn()) return; // dont redraw if LCD is off
|
if (!Bangle.isLCDOn()) return; // dont redraw if LCD is off
|
||||||
var steps = Bangle.getHealthStatus("day").steps;
|
var steps = Bangle.getHealthStatus("day").steps;
|
||||||
var w = 1 + (steps.toString().length)*12;
|
var w = 1 + (steps.toString().length)*12;
|
||||||
|
|
Loading…
Reference in New Issue