1
0
Fork 0

Merge pull request #831 from hughbarney/master

Pastel fixed for Gadgetbridge on a Bangle 2
master
Gordon Williams 2021-10-01 09:09:03 +01:00 committed by GitHub
commit 44aa03e428
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 16 additions and 10 deletions

View File

@ -3503,7 +3503,7 @@
"name": "Pastel Clock",
"shortName": "Pastel",
"icon": "pastel.png",
"version":"0.02",
"version":"0.03",
"description": "A Configurable clock with custom fonts and background",
"tags": "clock,b2",
"type":"clock",

View File

@ -1,2 +1,3 @@
0.01: First release
0.02: Display 12 hour clock as 12:xx not 00:xx when just into PM
0.03: Make it work with Gadgetbridge, Notifications fullscreen on a Bangle 2

View File

@ -51,7 +51,7 @@ const SETTINGS_FILE = "pastel.json";
let settings = undefined;
function loadSettings() {
//console.log("loadSettings()");
//Console.log("loadSettings()");
settings = require("Storage").readJSON(SETTINGS_FILE,1)||{};
settings.grid = settings.grid||false;
settings.date = settings.date||false;
@ -119,7 +119,7 @@ function draw() {
g.setFontAlign(1,-1); // right aligned
g.drawString(hh, x - 6, y);
g.setFontAlign(-1,-1); // left aligned
g.drawString(mm ,x + 6, y);
g.drawString(mm, x + 6, y);
// for the colon
g.setFontAlign(0,-1); // centre aligned
@ -143,17 +143,22 @@ function draw() {
}
}
// handle switch display on by pressing BTN1
// Only update when display turns on
if (process.env.BOARD!="SMAQ3") // hack for Q3 which is always-on
Bangle.on('lcdPower', function(on) {
if (on) draw();
if (secondInterval)
clearInterval(secondInterval);
secondInterval = undefined;
if (on)
secondInterval = setInterval(draw, 1000);
draw();
});
g.clear();
Bangle.loadWidgets();
Bangle.drawWidgets();
loadSettings();
setInterval(draw, 1000); // refresh every second
g.clear();
var secondInterval = setInterval(draw, 1000);
draw();
// Show launcher when button pressed
Bangle.setUI("clock");
Bangle.loadWidgets();
Bangle.drawWidgets();