Merge pull request #2381 from LeonMatthes/master

CalClock: 0.06 - Improved multi-line text
pull/2391/head
Gordon Williams 2022-12-12 09:04:37 +00:00 committed by GitHub
commit 526719f371
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 4 deletions

View File

@ -3,3 +3,4 @@
0.03: Tell clock widgets to hide.
0.04: Improve current time readability in light theme.
0.05: Show calendar colors & improved all day events.
0.06: Improved multi-line locations & titles

View File

@ -54,13 +54,15 @@ function drawEventBody(event, y) {
var yStart = y;
if (lines.length > 2) {
lines = lines.slice(0,2);
lines[1] = lines[1].slice(0,-3)+"...";
lines[1] += "...";
}
g.drawString(lines.join('\n'),10,y);
y+=20 * lines.length;
if(event.location) {
g.drawImage(atob("DBSBAA8D/H/nDuB+B+B+B3Dn/j/B+A8A8AYAYAYAAAAAAA=="),10,y);
g.drawString(event.location,25,y);
var loclines = g.wrapString(event.location, g.getWidth()-30);
if(loclines.length>1) loclines[0] += "...";
g.drawString(loclines[0],25,y);
y+=20;
}
if (event.color) {
@ -131,4 +133,3 @@ var minuteInterval = setInterval(redraw, 60 * 1000);
Bangle.setUI("clock");
Bangle.loadWidgets();
Bangle.drawWidgets();

View File

@ -2,7 +2,7 @@
"id": "calclock",
"name": "Calendar Clock",
"shortName": "CalClock",
"version": "0.05",
"version": "0.06",
"description": "Show the current and upcoming events synchronized from Gadgetbridge",
"icon": "calclock.png",
"type": "clock",