diff --git a/apps.json b/apps.json index 726b9d14b..6a9a73d30 100644 --- a/apps.json +++ b/apps.json @@ -80,7 +80,7 @@ "name": "Notifications (default)", "shortName":"Notifications", "icon": "notify.png", - "version":"0.03", + "version":"0.05", "description": "A handler for displaying notifications that displays them in a bar at the top of the screen", "tags": "widget", "type": "notify", @@ -93,7 +93,7 @@ "name": "Fullscreen Notifications", "shortName":"Notifications", "icon": "notify.png", - "version":"0.05", + "version":"0.06", "description": "A handler for displaying notifications that displays them fullscreen. This may not fully restore the screen after on some apps. See `Notifications (default)` for more information about the notifications library.", "tags": "widget", "type": "notify", diff --git a/apps/notify/ChangeLog b/apps/notify/ChangeLog index cb974e12d..558d62b31 100644 --- a/apps/notify/ChangeLog +++ b/apps/notify/ChangeLog @@ -1,3 +1,4 @@ 0.01: New Library! 0.02: Add notification ID option -0.03: Pass `area{x,y,w,h}` to render callback instead of just `y` \ No newline at end of file +0.03: Pass `area{x,y,w,h}` to render callback instead of just `y` +0.04: Adjust position of notification src text diff --git a/apps/notify/notify.js b/apps/notify/notify.js index d8168e048..6f5261de1 100644 --- a/apps/notify/notify.js +++ b/apps/notify/notify.js @@ -94,8 +94,8 @@ exports.show = function(options) { g.setColor(-1).setFontAlign(-1, -1, 0).setFont("6x8", 2); g.drawString(title.trim().substring(0, 13), x+25,y+3); if (options.title && options.src) { - g.setFont("6x8", 1); - g.drawString(options.src.substring(0, 10), x+215,y+5); + g.setFont("6x8", 1).setFontAlign(1, 1, 0); + g.drawString(options.src.substring(0, 10), g.getWidth()-23,y+18); } y += 20;h -= 20; } diff --git a/apps/notifyfs/ChangeLog b/apps/notifyfs/ChangeLog index b359d314b..16bc0ebb3 100644 --- a/apps/notifyfs/ChangeLog +++ b/apps/notifyfs/ChangeLog @@ -3,3 +3,4 @@ 0.03: Fix custom render callback 0.04: Pass `area{x,y,w,h}` to render callback instead of just `y` 0.05: Fix `g` corruption issue if .hide gets called twice +0.06: Adjust position of notification src text and notifications without title diff --git a/apps/notifyfs/notify.js b/apps/notifyfs/notify.js index 74a8d4912..2c622f624 100644 --- a/apps/notifyfs/notify.js +++ b/apps/notifyfs/notify.js @@ -49,14 +49,13 @@ exports.show = function(options) { if (size>120) {size=120} Bangle.setLCDMode("direct"); let x = 0, - y = 0, + y = 40, w = 240, - h = 240; + h = size; // clear screen g.clear(1); // top bar if (options.title||options.src) { - y=40;h=size; const title = options.title || options.src g.setColor(0x39C7).fillRect(x, y, x+w-1, y+30); g.setColor(-1).setFontAlign(-1, -1, 0).setFont("6x8", 3); @@ -64,7 +63,8 @@ exports.show = function(options) { if (options.title && options.src) { g.setColor(-1).setFontAlign(1, 1, 0).setFont("6x8", 2); // above drawing area, but we are fullscreen - g.drawString(options.src.substring(0, 10), x+235, y-32); + print(options.src.substring(0, 10), w-23, y-4); + g.drawString(options.src.substring(0, 10), w-16, y-4); } y += 30;h -= 30; }