Merge pull request #2783 from bobrippling/notify-bg

notify: improve title bg colour for dark theme
master
Gordon Williams 2023-06-05 09:44:08 +01:00 committed by GitHub
commit b64b71794f
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
4 changed files with 4 additions and 3 deletions

View File

@ -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

View File

@ -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",

View File

@ -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);

View File

@ -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);