diff --git a/bootloader/interface/src/menu.cpp b/bootloader/interface/src/menu.cpp index d45fb8466..c371bf01a 100644 --- a/bootloader/interface/src/menu.cpp +++ b/bootloader/interface/src/menu.cpp @@ -4,8 +4,6 @@ #include #include -#include - const Ion::Keyboard::Key Bootloader::Menu::k_breaking_keys[]; void Bootloader::Menu::setup() { @@ -36,15 +34,15 @@ int Bootloader::Menu::calculateCenterX(const char * text, int fontWidth) { void Bootloader::Menu::showMenu() { KDContext * ctx = KDIonContext::sharedContext(); ctx->fillRect(getScreen(), m_background); - Interface::drawImage(ctx, ImageStore::Computer, 25); - int y = ImageStore::Computer->height() + 25 + 10; + Interface::drawComputer(ctx, 25); + int y = Interface::computerHeight() + 25 + 10; int x = calculateCenterX(m_title, largeFontWidth()); ctx->drawString(m_title, KDPoint(x, y), k_large_font, m_foreground, m_background); y += largeFontHeight() + 10; //TODO: center the columns if m_centerY is true - for (ColumnBinder column : m_columns) { + for (ColumnBinder column : m_columns) { if (column.isNull()) { continue; } diff --git a/bootloader/interface/static/interface.cpp b/bootloader/interface/static/interface.cpp index 02ef4d0d2..c0e95db73 100644 --- a/bootloader/interface/static/interface.cpp +++ b/bootloader/interface/static/interface.cpp @@ -8,7 +8,9 @@ namespace Bootloader { -void Interface::drawImage(KDContext * ctx, const Image * image, int offset) { +void Interface::drawComputer(KDContext * ctx, int offset) { + const Image * image = ImageStore::Computer; + const uint8_t * data; size_t size; size_t pixelBufferSize; @@ -37,11 +39,15 @@ void Interface::drawImage(KDContext * ctx, const Image * image, int offset) { ctx->fillRectWithPixels(bounds, pixelBuffer, nullptr); } +KDCoordinate Interface::computerHeight() { + return ImageStore::Computer->height(); +} + void Interface::drawFlasher() { KDContext * ctx = KDIonContext::sharedContext(); ctx->fillRect(KDRect(0, 0, 320, 240), KDColorWhite); - drawImage(ctx, ImageStore::Computer, 25); + drawComputer(ctx, 25); KDSize fontSize = KDFont::LargeFont->glyphSize(); int initPos = (320 - fontSize.width() * strlen(Messages::mainTitle)) / 2; @@ -55,7 +61,7 @@ void Interface::drawFlasher() { void Interface::drawLoading() { KDContext * ctx = KDIonContext::sharedContext(); ctx->fillRect(KDRect(0, 0, 320, 240), KDColorWhite); - drawImage(ctx, ImageStore::Computer, 25); + drawComputer(ctx, 25); Ion::Timing::msleep(250); KDSize fontSize = KDFont::LargeFont->glyphSize(); int initPos = (320 - fontSize.width() * strlen(Messages::mainTitle)) / 2; diff --git a/bootloader/interface/static/interface.h b/bootloader/interface/static/interface.h index 3741b5ec1..ab44df846 100644 --- a/bootloader/interface/static/interface.h +++ b/bootloader/interface/static/interface.h @@ -9,7 +9,8 @@ namespace Bootloader { class Interface { public: - static void drawImage(KDContext * ctx, const Image * image, int offset); + static void drawComputer(KDContext * ctx, int offset); + static KDCoordinate computerHeight(); static void drawLoading(); static void drawFlasher(); };