Reduce font sizes, add orange header bar matching footer
This commit is contained in:
parent
adf623cd09
commit
ac5798e2db
1 changed files with 25 additions and 31 deletions
56
src/main.cpp
56
src/main.cpp
|
|
@ -198,63 +198,57 @@ void updatePrices() {
|
|||
void drawDashboard() {
|
||||
lcd.fillScreen(TFT_BLACK);
|
||||
|
||||
lcd.fillSmoothRoundRect(0, 0, SCREEN_WIDTH, 45, 8, TFT_ORANGE);
|
||||
lcd.setTextColor(TFT_WHITE, TFT_ORANGE);
|
||||
lcd.setFont(&fonts::DejaVu24);
|
||||
lcd.setTextDatum(textdatum_t::middle_left);
|
||||
lcd.drawString("HARD MONEY", 20, 22);
|
||||
lcd.drawString("STOCKS", 280, 22);
|
||||
lcd.drawString("INDICES", 540, 22);
|
||||
|
||||
int col1X = 20;
|
||||
int col2X = 280;
|
||||
int col3X = 540;
|
||||
int startY = 20;
|
||||
|
||||
lcd.setFont(&fonts::DejaVu18);
|
||||
lcd.setTextDatum(textdatum_t::top_left);
|
||||
|
||||
lcd.setTextColor(TFT_WHITE, TFT_BLACK);
|
||||
lcd.drawString("HARD MONEY", col1X, startY);
|
||||
|
||||
lcd.setTextColor(TFT_WHITE, TFT_BLACK);
|
||||
lcd.drawString("STOCKS", col2X, startY);
|
||||
|
||||
lcd.setTextColor(TFT_WHITE, TFT_BLACK);
|
||||
lcd.drawString("INDICES", col3X, startY);
|
||||
|
||||
int labelY = startY + 40;
|
||||
int priceY = labelY + 28;
|
||||
int labelY = 60;
|
||||
int priceY = labelY + 32;
|
||||
|
||||
lcd.setTextColor(TFT_ORANGE, TFT_BLACK);
|
||||
lcd.setFont(&fonts::DejaVu18);
|
||||
lcd.setFont(&fonts::DejaVu24);
|
||||
lcd.drawString("Bitcoin:", col1X, labelY);
|
||||
lcd.drawString(formatPriceUS(btcPrice, 0), col1X, priceY);
|
||||
|
||||
lcd.setTextColor(TFT_GOLD, TFT_BLACK);
|
||||
lcd.drawString("Gold:", col1X, labelY + 60);
|
||||
lcd.drawString(formatPriceUS(goldPrice, 2), col1X, priceY + 60);
|
||||
lcd.drawString("Gold:", col1X, labelY + 70);
|
||||
lcd.drawString(formatPriceUS(goldPrice, 2), col1X, priceY + 70);
|
||||
|
||||
lcd.setTextColor(TFT_SILVER, TFT_BLACK);
|
||||
lcd.drawString("Silver:", col1X, labelY + 120);
|
||||
lcd.drawString(formatPriceUS(silverPrice, 2), col1X, priceY + 120);
|
||||
lcd.drawString("Silver:", col1X, labelY + 140);
|
||||
lcd.drawString(formatPriceUS(silverPrice, 2), col1X, priceY + 140);
|
||||
|
||||
lcd.setTextColor(TFT_GREEN, TFT_BLACK);
|
||||
lcd.drawString("MSTR:", col2X, labelY);
|
||||
lcd.drawString(formatPriceUS(mstrPrice, 2), col2X, priceY);
|
||||
|
||||
lcd.drawString("STRC:", col2X, labelY + 60);
|
||||
lcd.drawString(formatPriceUS(strtPrice, 2), col2X, priceY + 60);
|
||||
lcd.drawString("STRC:", col2X, labelY + 70);
|
||||
lcd.drawString(formatPriceUS(strtPrice, 2), col2X, priceY + 70);
|
||||
|
||||
lcd.drawString("NASDAQ:", col3X, labelY);
|
||||
lcd.drawString(formatPriceUS(nasdaqPrice, 2), col3X, priceY);
|
||||
|
||||
lcd.drawString("DOW:", col3X, labelY + 60);
|
||||
lcd.drawString(formatPriceUS(dowPrice, 2), col3X, priceY + 60);
|
||||
lcd.drawString("DOW:", col3X, labelY + 70);
|
||||
lcd.drawString(formatPriceUS(dowPrice, 2), col3X, priceY + 70);
|
||||
|
||||
lcd.drawString("SPX:", col3X, labelY + 120);
|
||||
lcd.drawString(formatPriceUS(spxPrice, 2), col3X, priceY + 120);
|
||||
lcd.drawString("SPX:", col3X, labelY + 140);
|
||||
lcd.drawString(formatPriceUS(spxPrice, 2), col3X, priceY + 140);
|
||||
|
||||
lcd.fillSmoothRoundRect(0, SCREEN_HEIGHT - 35, SCREEN_WIDTH, 35, 6, TFT_ORANGE);
|
||||
lcd.fillSmoothRoundRect(0, SCREEN_HEIGHT - 40, SCREEN_WIDTH, 40, 8, TFT_ORANGE);
|
||||
lcd.setTextColor(TFT_WHITE, TFT_ORANGE);
|
||||
lcd.setFont(&fonts::DejaVu12);
|
||||
lcd.setFont(&fonts::DejaVu18);
|
||||
lcd.setTextDatum(textdatum_t::middle_left);
|
||||
String wifiStatus = WiFi.status() == WL_CONNECTED ? "Connected" : "DISCONNECTED";
|
||||
lcd.drawString("WiFi: " + wifiStatus, 15, SCREEN_HEIGHT - 17);
|
||||
lcd.drawString("WiFi: " + wifiStatus, 20, SCREEN_HEIGHT - 20);
|
||||
lcd.setTextDatum(textdatum_t::middle_center);
|
||||
lcd.drawString("TOUCH TO REFRESH", SCREEN_WIDTH / 2, SCREEN_HEIGHT - 17);
|
||||
lcd.drawString("TOUCH TO REFRESH", SCREEN_WIDTH / 2, SCREEN_HEIGHT - 20);
|
||||
}
|
||||
|
||||
void setup() {
|
||||
|
|
|
|||
Loading…
Add table
Reference in a new issue