icon.h was moved to esptftlib

This commit is contained in:
2023-01-16 16:12:58 +01:00
parent f673391ed3
commit 9c535eedb4
3 changed files with 2 additions and 21 deletions

View File

@ -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

View File

@ -1,17 +0,0 @@
#pragma once
// system includes
#include <cstdint>
namespace espgui {
template<uint16_t width, uint16_t height>
struct Icon
{
static constexpr auto WIDTH=width;
static constexpr auto HEIGHT=height;
const unsigned short buffer[width*height];
const char * const name{};
};
} // namespace espgui

View File

@ -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;