mirror of
https://github.com/meshcore-dev/MeshCore.git
synced 2026-04-20 22:13:47 +00:00
* UI revamp for companion radios
This commit is contained in:
parent
a310a5c4d5
commit
4b95c981bb
26 changed files with 840 additions and 323 deletions
|
|
@ -47,6 +47,7 @@ void GxEPDDisplay::clear() {
|
|||
|
||||
void GxEPDDisplay::startFrame(Color bkg) {
|
||||
display.fillScreen(GxEPD_WHITE);
|
||||
display.setTextColor(_curr_color = GxEPD_BLACK);
|
||||
}
|
||||
|
||||
void GxEPDDisplay::setTextSize(int sz) {
|
||||
|
|
@ -67,7 +68,11 @@ void GxEPDDisplay::setTextSize(int sz) {
|
|||
}
|
||||
|
||||
void GxEPDDisplay::setColor(Color c) {
|
||||
display.setTextColor(GxEPD_BLACK);
|
||||
if (c == DARK) {
|
||||
display.setTextColor(_curr_color = GxEPD_BLACK);
|
||||
} else {
|
||||
display.setTextColor(_curr_color = GxEPD_WHITE);
|
||||
}
|
||||
}
|
||||
|
||||
void GxEPDDisplay::setCursor(int x, int y) {
|
||||
|
|
@ -79,11 +84,11 @@ void GxEPDDisplay::print(const char* str) {
|
|||
}
|
||||
|
||||
void GxEPDDisplay::fillRect(int x, int y, int w, int h) {
|
||||
display.fillRect(x*SCALE_X, y*SCALE_Y, w*SCALE_X, h*SCALE_Y, GxEPD_BLACK);
|
||||
display.fillRect(x*SCALE_X, y*SCALE_Y, w*SCALE_X, h*SCALE_Y, _curr_color);
|
||||
}
|
||||
|
||||
void GxEPDDisplay::drawRect(int x, int y, int w, int h) {
|
||||
display.drawRect(x*SCALE_X, y*SCALE_Y, w*SCALE_X, h*SCALE_Y, GxEPD_BLACK);
|
||||
display.drawRect(x*SCALE_X, y*SCALE_Y, w*SCALE_X, h*SCALE_Y, _curr_color);
|
||||
}
|
||||
|
||||
void GxEPDDisplay::drawXbm(int x, int y, const uint8_t* bits, int w, int h) {
|
||||
|
|
@ -116,7 +121,7 @@ void GxEPDDisplay::drawXbm(int x, int y, const uint8_t* bits, int w, int h) {
|
|||
// If the bit is set, draw a block of pixels
|
||||
if (bitSet) {
|
||||
// Draw the block as a filled rectangle
|
||||
display.fillRect(x1, y1, block_w, block_h, GxEPD_BLACK);
|
||||
display.fillRect(x1, y1, block_w, block_h, _curr_color);
|
||||
}
|
||||
}
|
||||
}
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue