Pastel: added cycle through info items to bottom of screen

master
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.04: Leave space at the bottom for Chrono widget, set back option at first option
0.05: Added 2 new fonts 0.05: Added 2 new fonts
0.06: COnverted fonts to font modules 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 * Designed specifically for Bangle 1 and Bangle 2
* A choice of 7 different custom fonts * A choice of 7 different custom fonts
* Supports the Light and Dark themes * 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. 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; let settings;
function loadSettings() { function loadSettings() {
//console.log("loadSettings()");
settings = require("Storage").readJSON(SETTINGS_FILE,1)||{}; settings = require("Storage").readJSON(SETTINGS_FILE,1)||{};
settings.grid = settings.grid||false; settings.grid = settings.grid||false;
settings.date = settings.date||false;
settings.font = settings.font||"Lato"; settings.font = settings.font||"Lato";
//console.log(settings);
} }
function loadFonts() { function loadFonts() {
//console.log("loadFonts()");
console.log(settings);
// load font files based on settings.font // load font files based on settings.font
if (settings.font == "Architect") if (settings.font == "Architect")
require("f_architect").add(Graphics); 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"; var mm_prev = "xx";
function draw() { function draw() {
@ -174,12 +163,17 @@ Bangle.on('lcdPower', function(on) {
draw(); draw();
}); });
Bangle.setUI("clockupdown", btn=> {
if (btn<0) prevInfo();
if (btn>0) nextInfo();
draw();
});
loadSettings(); loadSettings();
loadFonts(); loadFonts();
g.clear(); g.clear();
var secondInterval = setInterval(draw, 1000); var secondInterval = setInterval(draw, 1000);
draw(); draw();
// Show launcher when button pressed
Bangle.setUI("clock");
Bangle.loadWidgets(); Bangle.loadWidgets();
Bangle.drawWidgets(); Bangle.drawWidgets();

View File

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