Skip to content

Commit

Permalink
Fixed Scrolling colors
Browse files Browse the repository at this point in the history
  • Loading branch information
bmorcelli committed Nov 27, 2024
1 parent 50e63bc commit f61709f
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 0 deletions.
5 changes: 5 additions & 0 deletions src/display.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -23,6 +23,7 @@ void displayScrollingText(const String& text, Opt_Coord& coord) {
int scrollLen = len + 8; // Full text plus space buffer
static int i=0;
static long _lastmillis=0;
tft.setTextColor(coord.fgcolor,coord.bgcolor);
if (len < coord.size) {
// Text fits within limit, no scrolling needed
return;
Expand Down Expand Up @@ -393,6 +394,8 @@ Opt_Coord drawOptions(int index,const std::vector<std::pair<std::string, std::fu
coord.x=WIDTH*0.10+5+FM*LW;
coord.y=tft.getCursorY()+4;
coord.size=(WIDTH*0.8 - 10)/(LW*FONT_M) - 1;
coord.fgcolor=fgcolor;
coord.bgcolor=bgcolor;
}
else text +=" ";
text += String(options[i].first.c_str()) + " ";
Expand Down Expand Up @@ -529,6 +532,8 @@ Opt_Coord listFiles(int index, String fileList[][3]) {
coord.x=10+FM*LW;
coord.y=tft.getCursorY();
coord.size=nchars;
coord.fgcolor=fileList[i][2]=="folder"? FGCOLOR-0x1111:FGCOLOR;
coord.bgcolor=BGCOLOR;
}
else txt=" ";
txt+=fileList[i][0] + " ";
Expand Down
2 changes: 2 additions & 0 deletions src/display.h
Original file line number Diff line number Diff line change
Expand Up @@ -38,6 +38,8 @@ struct Opt_Coord {
uint16_t x=0;
uint16_t y=0;
uint16_t size=10;
uint16_t fgcolor=FGCOLOR;
uint16_t bgcolor=BGCOLOR;
};
void displayScrollingText(const String& text, Opt_Coord& coord);

Expand Down

0 comments on commit f61709f

Please sign in to comment.