Skip to content

Commit

Permalink
changed fill color in progress bar
Browse files Browse the repository at this point in the history
  • Loading branch information
barry-ha committed Jan 26, 2024
1 parent ce7e8ae commit b1a78f7
Showing 1 changed file with 6 additions and 4 deletions.
10 changes: 6 additions & 4 deletions view.h
Original file line number Diff line number Diff line change
Expand Up @@ -118,6 +118,7 @@ class View {

void showProgressBar(int screen, int numScreens) {
// draw marker for advancing through settings, eg, 1 of 6, 2 of 6, etc.
// we try to make it look like a filled rectangle
int x0 = 74; // lhs bounding box
int y0 = 28; // top bounding box
int w = 320 - x0 - x0; // width of bounding box
Expand All @@ -126,11 +127,12 @@ class View {

int wi = w / numScreens; // width of each item
for (int ii = 0; ii < numScreens; ii++) {
// x, y, w, h, color
int xOuter = x0 + ii * wi;
tft->drawRect(xOuter, y0, wi, h, cFAINTER);

if (ii == (screen - 1)) {
// x, y, w, h, color
tft->fillRect(x0 + ii * wi, y0, wi, h, cFAINT);
} else {
tft->drawRect(x0 + ii * wi, y0, wi, h, cFAINTER);
tft->fillRect(xOuter + 1, y0, wi - 2, h, cLABEL);
}
}
}
Expand Down

0 comments on commit b1a78f7

Please sign in to comment.