MCPcopy Create free account
hub / github.com/Blueforcer/awtrix3 / drawMenuIndicator

Method drawMenuIndicator

src/DisplayManager.cpp:1465–1483  ·  view source on GitHub ↗

Source from the content-addressed store, hash-verified

1463}
1464
1465void DisplayManager_::drawMenuIndicator(int cur, int total, uint32_t color)
1466{
1467 int menuItemWidth = 1;
1468 int totalWidth = total * menuItemWidth + (total - 1);
1469 int leftMargin = (MATRIX_WIDTH - totalWidth) / 2;
1470 int pixelSpacing = 1;
1471 for (int i = 0; i < total; i++)
1472 {
1473 int x = leftMargin + i * (menuItemWidth + pixelSpacing);
1474 if (i == cur)
1475 {
1476 drawLine(x, 7, x + menuItemWidth - 1, 7, color);
1477 }
1478 else
1479 {
1480 drawLine(x, 7, x + menuItemWidth - 1, 7, 0x666666);
1481 }
1482 }
1483}
1484
1485void DisplayManager_::drawBarChart(int16_t x, int16_t y, const int data[], byte dataSize, bool withIcon, uint32_t color, uint32_t barBG)
1486{

Callers 1

menutextMethod · 0.80

Calls

no outgoing calls

Tested by

no test coverage detected