From 95a85e623ba7ffbd027181d1fc82b04dac6d4bad Mon Sep 17 00:00:00 2001 From: "Ben V. Brown" Date: Thu, 21 Mar 2024 21:08:54 +1100 Subject: [PATCH] Draw settings icons --- source/Core/Drivers/Font.h | 4 ++++ source/Core/Src/settingsGUI.cpp | 4 +++- 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/source/Core/Drivers/Font.h b/source/Core/Drivers/Font.h index ae0c169e..347143da 100644 --- a/source/Core/Drivers/Font.h +++ b/source/Core/Drivers/Font.h @@ -185,6 +185,8 @@ 0x0f, 0x07, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x80, 0xe0, 0xf8, 0xff, 0x3f, 0x07, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x00, 0x01, 0x03, 0x07, 0x0f, 0x0e, 0x1e, 0x1c, 0x1c, 0x38, 0x38, 0x38, 0x38, 0x38, 0x38, 0x1c, 0x1c, 0x1e, 0x0e, 0x0f, 0x07, 0x03, 0x01, 0x00, 0x00, 0x00, 0x00, 0x00}; + #define SETTINGS_ICON_WIDTH 21 + #define SETTINGS_ICON_HEIGHT 32 /* * 21x32 icons * 84 * 3 = Frame size * Frame count @@ -413,6 +415,8 @@ 0x00, 0xc0, 0x30, 0x08, 0x04, 0x04, 0x02, 0x82, 0xc2, 0xe2, 0x74, 0x24, 0x08, 0x30, 0xc0, 0x00, 0x00, 0x03, 0x0c, 0x10, 0x24, 0x2e, 0x47, 0x43, 0x41, 0x40, 0x20, 0x20, 0x10, 0x0c, 0x03, 0x00}; + #define SETTINGS_ICON_WIDTH 16 + #define SETTINGS_ICON_HEIGHT 16 /* * 16x16 icons * 32 * 3 = Frame size * Frame count diff --git a/source/Core/Src/settingsGUI.cpp b/source/Core/Src/settingsGUI.cpp index 7ee9c2da..985f503a 100644 --- a/source/Core/Src/settingsGUI.cpp +++ b/source/Core/Src/settingsGUI.cpp @@ -7,6 +7,7 @@ #include "settingsGUI.hpp" #include "Buttons.hpp" +#include "Font.h" #include "ScrollMessage.hpp" #include "TipThermoModel.h" #include "Translation.h" @@ -1017,7 +1018,8 @@ static void displayMenu(size_t index) { // Draw symbol // 16 pixel wide image // less 2 pixel wide scrolling indicator - OLED::drawArea(OLED_WIDTH - 16 - 2, 0, 16, 16, (&SettingsMenuIcons[index][(16 * 2) * currentFrame])); + + OLED::drawArea(OLED_WIDTH - SETTINGS_ICON_WIDTH - 2, 0, SETTINGS_ICON_WIDTH, SETTINGS_ICON_HEIGHT, (&SettingsMenuIcons[index][(SETTINGS_ICON_WIDTH * (SETTINGS_ICON_HEIGHT / 8)) * currentFrame])); } #if defined(POW_DC) || defined(POW_QC)