diff --git a/CMakeLists.txt b/CMakeLists.txt index a74b5f0..3f02886 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -28,7 +28,6 @@ set(headers src/errorhandlerinterface.h src/fontinterface.h src/graphdisplay.h - src/icon.h src/iconinterface.h src/keyboardhelper.h src/icons/back.h diff --git a/src/icon.h b/src/icon.h deleted file mode 100644 index 8ca8a1d..0000000 --- a/src/icon.h +++ /dev/null @@ -1,17 +0,0 @@ -#pragma once - -// system includes -#include - -namespace espgui { -template -struct Icon -{ - static constexpr auto WIDTH=width; - static constexpr auto HEIGHT=height; - - const unsigned short buffer[width*height]; - const char * const name{}; - -}; -} // namespace espgui diff --git a/src/menudisplay.cpp b/src/menudisplay.cpp index b1dc11e..3bfaf94 100644 --- a/src/menudisplay.cpp +++ b/src/menudisplay.cpp @@ -162,8 +162,7 @@ void MenuDisplay::redraw(TftInterface &tft) if (auto icon = item.selectedIcon()) { - tft.pushImage(tft.width() - 6 - icon->WIDTH, labelsIter->y() + 1, icon->WIDTH, icon->HEIGHT, - icon->buffer); + tft.pushImage(tft.width() - 6 - icon->WIDTH, labelsIter->y() + 1, *icon); } } } @@ -180,7 +179,7 @@ void MenuDisplay::redraw(TftInterface &tft) { auto icon = item.icon(); if (icon) - tft.pushImage(6, labelsIter->y() + 1, icon->WIDTH, icon->HEIGHT, icon->buffer); + tft.pushImage(6, labelsIter->y() + 1, *icon); else if (*iconsIter) tft.fillRect(6, labelsIter->y() + 1, 24, 24, selected ? TFT_GREY : TFT_BLACK); *iconsIter = icon;