slopeclockpp: avoid reusing background colour for clkinfo

pull/3525/head
Rob Pilling 2024-07-31 17:52:56 +01:00
parent 13f74e1542
commit bfa9a757dd
1 changed files with 4 additions and 4 deletions

View File

@ -128,9 +128,9 @@ let clockInfoDraw = (itm, info, options) => {
let texty = options.y+41;
// set a cliprect to stop us drawing outside our box
g.reset().setClipRect(options.x, options.y, options.x+options.w-1, options.y+options.h-1);
g.setFont("6x15").setBgColor(options.bg).setColor(options.fg).clearRect(options.x, texty-15, options.x+options.w-2, texty);
g.setFont("6x15").setBgColor(options.bg).clearRect(options.x, texty-15, options.x+options.w-2, texty);
if (options.focus) g.setColor(options.hl);
g.setColor(options.focus ? options.hl : options.fg);
if (options.x < g.getWidth()/2) { // left align
let x = options.x+2;
if (info.img) g.clearRect(x, options.y, x+23, options.y+23).drawImage(info.img, x, options.y);
@ -150,7 +150,7 @@ let clockInfoMenu = require("clock_info").addInteractive(clockInfoItems, { // t
});
let clockInfoMenu2 = require("clock_info").addInteractive(clockInfoItems, { // bottom left
app:"slopeclockpp",x:0, y:115, w:50, h:40,
draw : clockInfoDraw, bg : bgColor, fg : g.theme.bg, hl : (bgColor=="#000")?"#f00"/*red*/:g.theme.fg
draw : clockInfoDraw, bg : bgColor, fg : g.theme.bg, hl : (g.theme.fg===g.toColor(bgColor))?"#f00"/*red*/:g.theme.fg
});
// Show launcher when middle button pressed
@ -175,4 +175,4 @@ Bangle.loadWidgets();
if (settings.hideWidgets) require("widget_utils").swipeOn();
else setTimeout(Bangle.drawWidgets,0);
draw();
}
}