0.05: setUI, screen size changes

pull/765/head
Gordon Williams 2021-06-24 14:17:16 +01:00
parent 083eac0143
commit 490a0b9670
3 changed files with 12 additions and 10 deletions

View File

@ -852,9 +852,9 @@
{ "id": "sclock",
"name": "Simple Clock",
"icon": "clock-simple.png",
"version":"0.04",
"version":"0.05",
"description": "A Simple Digital Clock",
"tags": "clock",
"tags": "clock,b2",
"type":"clock",
"allow_emulator":true,
"storage": [

View File

@ -1,3 +1,4 @@
0.02: Modified for use with new bootloader and firmware
0.03: Actually make into 24h clock since there's a 12h variant
0.04: Make this clock do 12h and 24h
0.05: setUI, screen size changes

View File

@ -1,14 +1,15 @@
/* jshint esversion: 6 */
const timeFontSize = 6;
const dateFontSize = 3;
const big = g.getWidth()>200;
const timeFontSize = big?6:5;
const dateFontSize = big?3:2;
const gmtFontSize = 2;
const font = "6x8";
const xyCenter = g.getWidth() / 2;
const yposTime = 75;
const yposDate = 130;
const yposYear = 175;
const yposGMT = 220;
const yposTime = xyCenter*0.6;
const yposDate = xyCenter*1.1;
const yposYear = xyCenter*1.4;
const yposGMT = xyCenter*1.9;
// Check settings for what type our clock should be
var is12Hour = (require("Storage").readJSON("setting.json",1)||{})["12hour"];
@ -77,5 +78,5 @@ setInterval(drawSimpleClock, 15E3);
// draw now
drawSimpleClock();
// Show launcher when middle button pressed
setWatch(Bangle.showLauncher, BTN2, {repeat:false,edge:"falling"});
// Show launcher when button pressed
Bangle.setUI("clock");