mirror of https://github.com/espruino/BangleApps
Merge pull request #838 from hughbarney/master
notifyfs: fix title to use theme and adjust title font to fitpull/839/head
commit
a2c400780d
|
@ -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",
|
||||
|
|
|
@ -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
|
||||
|
|
|
@ -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);
|
||||
|
|
Loading…
Reference in New Issue