MCPcopy Create free account
hub / github.com/BruceDevices/firmware / drawButton

Function drawButton

src/core/display.cpp:161–172  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

159}
160
161void drawButton(
162 int32_t x, int32_t y, int32_t w, int32_t h, uint32_t color, const char *text, bool inverted = false
163) {
164 if (inverted) {
165 tft.fillRoundRect(x, y, w, h, 5, color);
166 } else {
167 tft.fillRoundRect(x, y, w, h, 5, TFT_BLACK);
168 tft.drawRoundRect(x, y, w, h, 5, color);
169 }
170 tft.setTextColor(inverted ? TFT_BLACK : color);
171 tft.drawString(text, x + w / 2, y + h);
172}
173
174int8_t displayMessage(
175 const char *message, const char *leftButton, const char *centerButton, const char *rightButton,

Callers 1

displayMessageFunction · 0.70

Calls 4

fillRoundRectMethod · 0.45
drawRoundRectMethod · 0.45
setTextColorMethod · 0.45
drawStringMethod · 0.45

Tested by

no test coverage detected