feat(display): add render method for menu items

This commit is contained in:
2026-04-28 19:54:41 +02:00
parent f2fbb9f205
commit 075ecdf1e2
2 changed files with 17 additions and 0 deletions
+15
View File
@@ -12,6 +12,21 @@ void Display::clear() {
lcd.clear();
}
void Display::drawMenu(Menu &menu) {
clear();
size_t currentItemIndex = menu.getCurrentItemIndex();
for (size_t i = 0; i < MENU_ITEM_COUNT; i++) {
lcd.setCursor(0, i);
Item& item = menu.getItemAt(i);
if (i == currentItemIndex) {
lcd.print("> " + item.name);
} else {
lcd.print(" " + item.name);
}
}
}
LiquidCrystal_I2C& Display::getLCD() {
return lcd;
}