Pastel: added cycle through info items to bottom of screen

pull/932/head
hughbarney 2021-11-24 19:59:46 +00:00
parent c6096675fb
commit 37ca625174
4 changed files with 11 additions and 23 deletions

View File

@ -4,3 +4,4 @@
0.04: Leave space at the bottom for Chrono widget, set back option at first option
0.05: Added 2 new fonts
0.06: COnverted fonts to font modules
0.07: Added info line that cycles on BTN1/BTN3 (or vitual buttons on a bangle 2)

View File

@ -3,7 +3,9 @@
* Designed specifically for Bangle 1 and Bangle 2
* A choice of 7 different custom fonts
* Supports the Light and Dark themes
* Has a settings menu, change font, enable/disable the grid and the date display
* Has a settings menu, change font, enable/disable the grid
* On Bangle 1 use BTN1,BTN3 to cycle through the info display (Date, ID, Batt %, Ram % etc)
* On Bangle 2 touch the top right/top left to cycle through the info display (Date, ID, Batt %, Ram % etc)
I came up with the name Pastel due to the shade of the grid background.

View File

@ -3,18 +3,12 @@ const SETTINGS_FILE = "pastel.json";
let settings;
function loadSettings() {
//console.log("loadSettings()");
settings = require("Storage").readJSON(SETTINGS_FILE,1)||{};
settings.grid = settings.grid||false;
settings.date = settings.date||false;
settings.font = settings.font||"Lato";
//console.log(settings);
}
function loadFonts() {
//console.log("loadFonts()");
console.log(settings);
// load font files based on settings.font
if (settings.font == "Architect")
require("f_architect").add(Graphics);
@ -71,11 +65,6 @@ function prevInfo() {
}
}
Bangle.on('swipe', dir => {
if (dir == 1) prevInfo(); else nextInfo();
draw();
});
var mm_prev = "xx";
function draw() {
@ -174,12 +163,17 @@ Bangle.on('lcdPower', function(on) {
draw();
});
Bangle.setUI("clockupdown", btn=> {
if (btn<0) prevInfo();
if (btn>0) nextInfo();
draw();
});
loadSettings();
loadFonts();
g.clear();
var secondInterval = setInterval(draw, 1000);
draw();
// Show launcher when button pressed
Bangle.setUI("clock");
Bangle.loadWidgets();
Bangle.drawWidgets();

View File

@ -4,7 +4,6 @@
// initialize with default settings...
let s = {
'grid': false,
'date': false,
'font': "Lato"
}
@ -43,14 +42,6 @@
s.grid = !s.grid
save()
},
},
'Show Date': {
value: s.date,
format: () => (s.date ? 'Yes' : 'No'),
onchange: () => {
s.date = !s.date
save()
},
}
})
})