Update Layout.js

added functionality for button colour specifications
master
nravanelli 2023-01-19 13:09:35 -05:00 committed by GitHub
parent 84510e46cc
commit a725dc7a78
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 6 additions and 2 deletions

View File

@ -186,8 +186,12 @@ Layout.prototype.render = function (l) {
x+4,y+h-1, x+4,y+h-1,
x,y+h-5, x,y+h-5,
x,y+4 x,y+4
], bg = l.selected?gfx.theme.bgH:gfx.theme.bg2; ], bg = l.selected?gfx.theme.bgH:gfx.theme.bg2,
gfx.setColor(bg).fillPoly(poly).setColor(l.selected ? gfx.theme.fgH : gfx.theme.fg2).drawPoly(poly); btnborder = l.selected?gfx.theme.fgH:gfx.theme.fg2;
//add button color option
if(l.btnCol!==undefined) bg = l.btnCol;
if(l.btnBorder1!==undefined) btnborder = l.btnBorder;
gfx.setColor(bg).fillPoly(poly).setColor(btnborder).drawPoly(poly);
if (l.col!==undefined) gfx.setColor(l.col); if (l.col!==undefined) gfx.setColor(l.col);
if (l.src) gfx.setBgColor(bg).drawImage( if (l.src) gfx.setBgColor(bg).drawImage(
"function"==typeof l.src?l.src():l.src, "function"==typeof l.src?l.src():l.src,