notifyfs - use theme for title and adjust font

pull/838/head
hughbarney 2021-10-04 12:41:59 +01:00
parent eb8d9940dd
commit 1bbb0cb0d6
3 changed files with 5 additions and 4 deletions

View File

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

View File

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

View File

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