mirror of https://github.com/espruino/BangleApps
notifyfs - use theme for title and adjust font
parent
eb8d9940dd
commit
1bbb0cb0d6
|
@ -107,7 +107,7 @@
|
||||||
"name": "Fullscreen Notifications",
|
"name": "Fullscreen Notifications",
|
||||||
"shortName":"Notifications",
|
"shortName":"Notifications",
|
||||||
"icon": "notify.png",
|
"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.",
|
"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",
|
"tags": "widget,b2",
|
||||||
"type": "notify",
|
"type": "notify",
|
||||||
|
|
|
@ -9,3 +9,4 @@
|
||||||
0.09: Add onHide callback
|
0.09: Add onHide callback
|
||||||
0.10: Ensure dismissing a notification dismissal doesn't enter launcher if in clock mode
|
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.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
|
||||||
|
|
|
@ -1,7 +1,7 @@
|
||||||
let oldg;
|
let oldg;
|
||||||
let id = null;
|
let id = null;
|
||||||
let hideCallback = null;
|
let hideCallback = null;
|
||||||
|
const titleFont = g.getWidth() / 8;
|
||||||
/**
|
/**
|
||||||
* See notify/notify.js
|
* See notify/notify.js
|
||||||
*/
|
*/
|
||||||
|
@ -63,8 +63,8 @@ exports.show = function(options) {
|
||||||
// top bar
|
// top bar
|
||||||
if (options.title||options.src) {
|
if (options.title||options.src) {
|
||||||
const title = 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(options.titleBgColor||g.theme.bgH).fillRect(x, y, x+w-1, y+30);
|
||||||
g.setColor(g.theme.fg).setFontAlign(-1, -1, 0).setFont("6x8", 3);
|
g.setColor(g.theme.fgH).setFontAlign(-1, -1, 0).setFont("Vector", titleFont);
|
||||||
g.drawString(title.trim().substring(0, 13), x+5, y+3);
|
g.drawString(title.trim().substring(0, 13), x+5, y+3);
|
||||||
if (options.title && options.src) {
|
if (options.title && options.src) {
|
||||||
g.setColor(g.theme.fg).setFontAlign(1, 1, 0).setFont("6x8", 2);
|
g.setColor(g.theme.fg).setFontAlign(1, 1, 0).setFont("6x8", 2);
|
||||||
|
|
Loading…
Reference in New Issue