diff --git a/apps.json b/apps.json index 8ce8bc3d8..1d3983aa6 100644 --- a/apps.json +++ b/apps.json @@ -904,9 +904,9 @@ { "id": "dclock", "name": "Dev Clock", "icon": "clock-dev.png", - "version":"0.09", + "version":"0.10", "description": "A Digital Clock including timestamp (tst), beats(@), days in current month (dm) and days since new moon (l)", - "tags": "clock", + "tags": "clock,b2", "type":"clock", "allow_emulator":true, "storage": [ @@ -1168,9 +1168,9 @@ { "id": "ctrclk", "name": "Centerclock", "icon": "app.png", - "version":"0.02", + "version":"0.03", "description": "Watch-centered digital 24h clock with date in dd.mm.yyyy format.", - "tags": "clock", + "tags": "clock,nob2", "type":"clock", "allow_emulator":true, "storage": [ @@ -3051,7 +3051,7 @@ "version":"0.01", "description": "Displays RGB565 and RGB888 colors, its name and code in screen.", "readme": "README.md", - "tags": "Color, input,buttons,touch,UI", + "tags": "Color,input,buttons,touch,UI,nob2", "storage": [ {"name":"color_catalog.app.js","url":"app.js"}, {"name":"color_catalog.img","url":"app-icon.js","evaluate":true} diff --git a/apps/ctrclk/ChangeLog b/apps/ctrclk/ChangeLog index 7819dbe2a..e4659c1ae 100644 --- a/apps/ctrclk/ChangeLog +++ b/apps/ctrclk/ChangeLog @@ -1 +1,2 @@ 0.02: Modified for use with new bootloader and firmware +0.03: Changed setWatch to Bangle.setUI diff --git a/apps/ctrclk/app.js b/apps/ctrclk/app.js index 060aac2f9..7f6ab0570 100644 --- a/apps/ctrclk/app.js +++ b/apps/ctrclk/app.js @@ -46,26 +46,25 @@ function drawSegment (align, base, str) { point = base + (maxSegmentWidth / 2) - (g.stringWidth(str) / 2); } - g.setColor(1, 1, 1); + g.setColor(g.theme.fg); g.drawString(str, point, middleY - 4, false); } function drawDots (center) { - g.setColor(0xFD20); + g.setColor("#FA0"); g.fillCircle(center, middleY + 10, 2); g.fillCircle(center, middleY + 40, 2); } function drawLines () { - g.setColor(0.5, 0.5, 0.5); + g.setColor("#777"); g.drawLine(middleX - lineLength, lineY1, middleX + lineLength, lineY1); g.drawLine(middleX - lineLength, lineY2, middleX + lineLength, lineY2); } function drawDate (str) { let maxSegmentWidth = 236; - g.setColor(0.5, 0.5, 0.5); - g.setColor(0.5, 0.5, 0.5); + g.setColor("#777"); g.drawString(str, (maxSegmentWidth) - (g.stringWidth(str)), middleY - 22, false); } @@ -149,6 +148,9 @@ function start () { } start(); +// Show launcher when middle button pressed +Bangle.setUI("clock"); + Bangle.loadWidgets(); Bangle.drawWidgets(); Bangle.on('lcdPower', function (on) { @@ -158,6 +160,3 @@ Bangle.on('lcdPower', function (on) { stop(); } }); - -// Show launcher when middle button pressed -setWatch(Bangle.showLauncher, BTN2, {repeat:false,edge:"falling"}); diff --git a/apps/dclock/ChangeLog b/apps/dclock/ChangeLog index edf7da4c2..aa8ae23fe 100644 --- a/apps/dclock/ChangeLog +++ b/apps/dclock/ChangeLog @@ -7,3 +7,4 @@ 0.07: add days in current month (md) and days since new moon (l) 0.08: update icon 0.09: Use localised month and day of the week from locale +0.10: Changed setWatch to Bangle.setUI and allow small screen diff --git a/apps/dclock/clock-dev.js b/apps/dclock/clock-dev.js index d2c08726a..d2c3893d5 100644 --- a/apps/dclock/clock-dev.js +++ b/apps/dclock/clock-dev.js @@ -1,17 +1,18 @@ var locale = require("locale"); /* jshint esversion: 6 */ -const timeFontSize = 4; -const dateFontSize = 3; -const smallFontSize = 2; +const big = g.getWidth()>200; +const timeFontSize = big?4:3; +const dateFontSize = big?3:2; +const smallFontSize = big?2:1; const font = "6x8"; const xyCenter = g.getWidth() / 2; const yposTime = 50; -const yposDate = 85; -const yposTst = 115; -const yposDml = 170; -const yposDayMonth = 195; -const yposGMT = 220; +const yposDate = big?85:75; +const yposTst = big?115:95; +const yposDml = big?170:130; +const yposDayMonth = big?195:140; +const yposGMT = big?220:150; // Check settings for what type our clock should be var is12Hour = (require("Storage").readJSON("setting.json",1)||{})["12hour"]; @@ -99,6 +100,8 @@ Bangle.on('lcdPower', function(on) { // clean app screen g.clear(); +// Show launcher when button pressed +Bangle.setUI("clock"); Bangle.loadWidgets(); Bangle.drawWidgets(); @@ -107,6 +110,3 @@ setInterval(drawSimpleClock, 100); // draw now drawSimpleClock(); - -// Show launcher when middle button pressed -setWatch(Bangle.showLauncher, BTN2, {repeat:false,edge:"falling"}); \ No newline at end of file