Merge pull request #1156 from Cramill/patch-1

Update calendar weekend colors for start on Sunday
pull/1202/head^2
Gordon Williams 2022-01-04 11:02:03 +00:00 committed by GitHub
commit 82723965b7
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
1 changed files with 13 additions and 4 deletions

View File

@ -110,10 +110,19 @@ function drawCalendar(date) {
g.clearRect(0, 0, maxX, maxY);
g.setBgColor(bgColorMonth);
g.clearRect(0, 0, maxX, headerH);
g.setBgColor(bgColorDow);
g.clearRect(0, headerH, maxX, headerH + rowH);
g.setBgColor(bgColorWeekend);
g.clearRect(colW * 5, headerH + rowH, maxX, maxY);
if (settings.startOnSun){
g.setBgColor(bgColorWeekend);
g.clearRect(0, headerH + rowH, colW, maxY);
g.setBgColor(bgColorDow);
g.clearRect(0, headerH, maxX, headerH + rowH);
g.setBgColor(bgColorWeekend);
g.clearRect(colW * 6, headerH + rowH, maxX, maxY);
} else {
g.setBgColor(bgColorDow);
g.clearRect(0, headerH, maxX, headerH + rowH);
g.setBgColor(bgColorWeekend);
g.clearRect(colW * 5, headerH + rowH, maxX, maxY);
}
for (let y = headerH; y < maxY; y += rowH) {
g.drawLine(0, y, maxX, y);
}