From f3f223eff52c68cda2198561c3081c7ac2057d27 Mon Sep 17 00:00:00 2001 From: Rob Pilling Date: Mon, 29 May 2023 16:20:13 +0100 Subject: [PATCH] notify: permit 0x0 colour and fallback depending on theme --- apps/notify/ChangeLog | 1 + apps/notify/metadata.json | 2 +- apps/notify/notify_bjs1.js | 2 +- apps/notify/notify_bjs2.js | 2 +- 4 files changed, 4 insertions(+), 3 deletions(-) diff --git a/apps/notify/ChangeLog b/apps/notify/ChangeLog index d7b754ff9..f40490488 100644 --- a/apps/notify/ChangeLog +++ b/apps/notify/ChangeLog @@ -9,3 +9,4 @@ 0.10: Improvements to help notifications work with themes 0.11: Fix regression that caused no notifications and corrupted background 0.12: Add Bangle.js 2 support with Bangle.setLCDOverlay +0.13: Add a default title background for the dark theme diff --git a/apps/notify/metadata.json b/apps/notify/metadata.json index 1cc8f52c1..bab68127c 100644 --- a/apps/notify/metadata.json +++ b/apps/notify/metadata.json @@ -2,7 +2,7 @@ "id": "notify", "name": "Notifications (default)", "shortName": "Notifications", - "version": "0.12", + "version": "0.13", "description": "Provides the default `notify` module used by applications to display notifications on the screen. This module is installed by default by client applications such as the Gadgetbridge app. Installing `Fullscreen Notifications` replaces this module with a version that displays the notifications using the full screen", "icon": "notify.png", "type": "notify", diff --git a/apps/notify/notify_bjs1.js b/apps/notify/notify_bjs1.js index fb56e4bbc..4ff8f88e9 100644 --- a/apps/notify/notify_bjs1.js +++ b/apps/notify/notify_bjs1.js @@ -103,7 +103,7 @@ exports.show = function(options) { b -= 2;h -= 2; // title bar if (options.title || options.src) { - g.setColor(options.titleBgColor||0x39C7).fillRect(x,y, r,y+20); + g.setColor("titleBgColor" in options ? options.titleBgColor : g.theme.dark ? 0x1 : 0x39C7).fillRect(x,y, r,y+20); const title = options.title||options.src; g.setColor(g.theme.fg).setFontAlign(-1, -1, 0).setFont("6x8", 2); g.drawString(title.trim().substring(0, 13), x+25,y+3); diff --git a/apps/notify/notify_bjs2.js b/apps/notify/notify_bjs2.js index c202e8c55..456c4e929 100644 --- a/apps/notify/notify_bjs2.js +++ b/apps/notify/notify_bjs2.js @@ -100,7 +100,7 @@ exports.show = function(options) { gg.clearRect(x,y, r,b); // title bar if (options.title || options.src) { - gg.setColor(options.titleBgColor||0x39C7).fillRect(x,y, r,y+20); + gg.setColor("titleBgColor" in options ? options.titleBgColor : g.theme.dark ? 0x1 : 0x39C7).fillRect(x,y, r,y+20); const title = options.title||options.src; gg.setColor(g.theme.fg).setFontAlign(-1, -1, 0).setFont("6x8", 2); gg.drawString(title.trim().substring(0, 13), x+25,y+3);