icon.h was moved to esptftlib
This commit is contained in:
@ -28,7 +28,6 @@ set(headers
|
|||||||
src/errorhandlerinterface.h
|
src/errorhandlerinterface.h
|
||||||
src/fontinterface.h
|
src/fontinterface.h
|
||||||
src/graphdisplay.h
|
src/graphdisplay.h
|
||||||
src/icon.h
|
|
||||||
src/iconinterface.h
|
src/iconinterface.h
|
||||||
src/keyboardhelper.h
|
src/keyboardhelper.h
|
||||||
src/icons/back.h
|
src/icons/back.h
|
||||||
|
17
src/icon.h
17
src/icon.h
@ -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
|
|
@ -162,8 +162,7 @@ void MenuDisplay::redraw(TftInterface &tft)
|
|||||||
|
|
||||||
if (auto icon = item.selectedIcon())
|
if (auto icon = item.selectedIcon())
|
||||||
{
|
{
|
||||||
tft.pushImage(tft.width() - 6 - icon->WIDTH, labelsIter->y() + 1, icon->WIDTH, icon->HEIGHT,
|
tft.pushImage(tft.width() - 6 - icon->WIDTH, labelsIter->y() + 1, *icon);
|
||||||
icon->buffer);
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
@ -180,7 +179,7 @@ void MenuDisplay::redraw(TftInterface &tft)
|
|||||||
{
|
{
|
||||||
auto icon = item.icon();
|
auto icon = item.icon();
|
||||||
if (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)
|
else if (*iconsIter)
|
||||||
tft.fillRect(6, labelsIter->y() + 1, 24, 24, selected ? TFT_GREY : TFT_BLACK);
|
tft.fillRect(6, labelsIter->y() + 1, 24, 24, selected ? TFT_GREY : TFT_BLACK);
|
||||||
*iconsIter = icon;
|
*iconsIter = icon;
|
||||||
|
Reference in New Issue
Block a user