From e069a3870cdd56e11d4faf9d824a0b29d737b625 Mon Sep 17 00:00:00 2001 From: Gordon Williams Date: Fri, 2 Aug 2024 15:48:15 +0100 Subject: [PATCH] twotwoclock 0.02: Clockinfos now save under correct name, and wrap correctly to >1 line --- apps/twotwoclock/ChangeLog | 1 + apps/twotwoclock/app.js | 8 ++++---- apps/twotwoclock/metadata.json | 2 +- 3 files changed, 6 insertions(+), 5 deletions(-) diff --git a/apps/twotwoclock/ChangeLog b/apps/twotwoclock/ChangeLog index 09953593e..d3275c0e8 100644 --- a/apps/twotwoclock/ChangeLog +++ b/apps/twotwoclock/ChangeLog @@ -1 +1,2 @@ 0.01: New Clock! +0.02: Clockinfos now save under correct name, and wrap correctly to >1 line \ No newline at end of file diff --git a/apps/twotwoclock/app.js b/apps/twotwoclock/app.js index 57be691e1..b2d5ea9fb 100644 --- a/apps/twotwoclock/app.js +++ b/apps/twotwoclock/app.js @@ -134,8 +134,8 @@ for (var i=0;i<10;i++) if (g.stringWidth(txt) > options.w) // if too big, smaller font g.setFont("LECO1976Regular14"); if (g.stringWidth(txt) > options.w) {// if still too big, split to 2 lines - var l = g.wrapString(txt, options.w); - txt = l.slice(0,2).join("\n") + (l.length>2)?"...":""; + var l = g.wrapString(txt, options.w-4); + txt = l.slice(0,2).join("\n") + ((l.length>2)?"...":""); } var x = options.x+options.w/2, y = options.y+54; g.setColor(g.theme.bg).drawString(txt, x-2, y). // draw the text background @@ -147,12 +147,12 @@ for (var i=0;i<10;i++) }; clockInfoMenuA = require("clock_info").addInteractive(clockInfoItems, { - app:"pebblepp", + app:"twotwoclock", x : g.getWidth()-clockInfoW, y: 0, w: clockInfoW, h:clockInfoH, draw : clockInfoDraw }); clockInfoMenuB = require("clock_info").addInteractive(clockInfoItems, { - app:"pebblepp", + app:"twotwoclock", x : g.getWidth()-clockInfoW, y: clockInfoH, w: clockInfoW, h:clockInfoH, draw : clockInfoDraw }); diff --git a/apps/twotwoclock/metadata.json b/apps/twotwoclock/metadata.json index ebcba539c..ae3b958ef 100644 --- a/apps/twotwoclock/metadata.json +++ b/apps/twotwoclock/metadata.json @@ -1,7 +1,7 @@ { "id": "twotwoclock", "name": "TwoTwo Clock", "shortName":"22 Clock", - "version":"0.01", + "version":"0.02", "description": "A clock with the time split over two lines, with custom backgrounds and two ClockInfos", "icon": "icon.png", "type": "clock",