From 1bbb0cb0d603da2ea7ea9236d1577513960e21b3 Mon Sep 17 00:00:00 2001 From: hughbarney Date: Mon, 4 Oct 2021 12:41:59 +0100 Subject: [PATCH] notifyfs - use theme for title and adjust font --- apps.json | 2 +- apps/notifyfs/ChangeLog | 1 + apps/notifyfs/notify.js | 6 +++--- 3 files changed, 5 insertions(+), 4 deletions(-) diff --git a/apps.json b/apps.json index 832a480cf..b6311a48f 100644 --- a/apps.json +++ b/apps.json @@ -107,7 +107,7 @@ "name": "Fullscreen Notifications", "shortName":"Notifications", "icon": "notify.png", - "version":"0.11", + "version":"0.12", "description": "Provides a replacement for the `Notifications (default)` `notify` module. This version is used by applications to display notifications fullscreen. This may not fully restore the screen after on some apps. See `Notifications (default)` for more information about the notify module.", "tags": "widget,b2", "type": "notify", diff --git a/apps/notifyfs/ChangeLog b/apps/notifyfs/ChangeLog index 1c39bcbd5..cf0a13866 100644 --- a/apps/notifyfs/ChangeLog +++ b/apps/notifyfs/ChangeLog @@ -9,3 +9,4 @@ 0.09: Add onHide callback 0.10: Ensure dismissing a notification dismissal doesn't enter launcher if in clock mode 0.11: Improvements to help notifications work with themes, Bangle.js 2 support +0.12: More use of themes, title now uses theme highlight colors, font adjusts diff --git a/apps/notifyfs/notify.js b/apps/notifyfs/notify.js index a45d889f0..9cadbb124 100644 --- a/apps/notifyfs/notify.js +++ b/apps/notifyfs/notify.js @@ -1,7 +1,7 @@ let oldg; let id = null; let hideCallback = null; - +const titleFont = g.getWidth() / 8; /** * See notify/notify.js */ @@ -63,8 +63,8 @@ exports.show = function(options) { // top bar if (options.title||options.src) { const title = options.title || options.src; - g.setColor(options.titleBgColor||"#333").fillRect(x, y, x+w-1, y+30); - g.setColor(g.theme.fg).setFontAlign(-1, -1, 0).setFont("6x8", 3); + g.setColor(options.titleBgColor||g.theme.bgH).fillRect(x, y, x+w-1, y+30); + g.setColor(g.theme.fgH).setFontAlign(-1, -1, 0).setFont("Vector", titleFont); g.drawString(title.trim().substring(0, 13), x+5, y+3); if (options.title && options.src) { g.setColor(g.theme.fg).setFontAlign(1, 1, 0).setFont("6x8", 2);