forked from FOSS/BangleApps
remove special chars for 7seg font
parent
f3db296830
commit
a0459c06b4
|
@ -38,7 +38,7 @@ let clockInfoDraw = (itm, info, options) => {
|
|||
|
||||
if (info.img) g.drawImage(info.img, options.x+2, options.y+2);
|
||||
var title = clockInfoItems[options.menuA].name;
|
||||
var text = info.text.toString().toUpperCase();
|
||||
var text = info.text.toString().toUpperCase().replace(/[^A-Z0-9]/g, "");
|
||||
if (title!="Bangle") g.setFontAlign(1,0).drawString(title.toUpperCase(), options.x+options.w-2, options.y+14);
|
||||
if (g.setFont("7Seg:2").stringWidth(text)+8>options.w) g.setFont("7Seg");
|
||||
g.setFontAlign(0,0).drawString(text, options.x+options.w/2, options.y+40);
|
||||
|
@ -82,4 +82,4 @@ Bangle.drawWidgets();
|
|||
let clockInfoItems = require("clock_info").load();
|
||||
let clockInfoMenu = require("clock_info").addInteractive(clockInfoItems, { app:"lcdclock", x:R.x, y:R.y, w:midX-2, h:barY-R.y-2, draw : clockInfoDraw});
|
||||
let clockInfoMenu2 = require("clock_info").addInteractive(clockInfoItems, { app:"lcdclock", x:midX+2, y:R.y, w:midX-3, h:barY-R.y-2, draw : clockInfoDraw});
|
||||
}
|
||||
}
|
||||
|
|
Loading…
Reference in New Issue