refactor(color): UI code cleanup, speed up loading of complex pages (#5031)

This commit is contained in:
philmoz
2024-06-06 20:08:13 +10:00
committed by GitHub
parent 65e05085a4
commit 97f9884639
176 changed files with 3747 additions and 3534 deletions
+1 -1
View File
@@ -3077,7 +3077,7 @@ LROT_BEGIN(etxcst, NULL, 0)
LROT_NUMENTRY( TEXT_SIZE, ZoneOption::TextSize )
LROT_NUMENTRY( ALIGNMENT, ZoneOption::Align )
LROT_NUMENTRY( SWITCH, ZoneOption::Switch )
LROT_NUMENTRY( MENU_HEADER_HEIGHT, COLOR2FLAGS(MENU_HEADER_HEIGHT) )
LROT_NUMENTRY( MENU_HEADER_HEIGHT, COLOR2FLAGS(EdgeTxStyles::MENU_HEADER_HEIGHT) )
// Colors gui/colorlcd/colors.h
LROT_NUMENTRY( COLOR_THEME_PRIMARY1, COLOR2FLAGS(COLOR_THEME_PRIMARY1_INDEX) )
+2 -2
View File
@@ -735,7 +735,7 @@ void displayLuaError(bool firstCall = false)
coord_t w = 0.75 * LCD_W;
coord_t left = (LCD_W - w) / 2;
#if (LCD_W > LCD_H)
#if (!PORTRAIT_LCD)
coord_t hh = getFontHeight(FONT(XL)) + 4;
#else
coord_t hh = getFontHeight(FONT(L)) + 4;
@@ -750,7 +750,7 @@ void displayLuaError(bool firstCall = false)
luaLcdBuffer->drawSolidFilledRect(left, top - hh, w, hh, COLOR_THEME_SECONDARY1);
luaLcdBuffer->drawSolidFilledRect(left, top, w, h, COLOR_THEME_SECONDARY3);
#if (LCD_W > LCD_H)
#if (!PORTRAIT_LCD)
luaLcdBuffer->drawText(left + 10, top - hh + 2, title, FONT(XL) | COLOR_THEME_PRIMARY2);
luaLcdBuffer->drawTextLines(left + 10, top + 5, w - 20, h - 10, lua_warning_info, FONT(L) | COLOR_THEME_PRIMARY1);
#else
-2
View File
@@ -79,7 +79,6 @@ void luaInitThemesAndWidgets();
void luaInit();
void luaEmptyEventBuffer();
#define LUA_INIT_THEMES_AND_WIDGETS() luaInitThemesAndWidgets()
#define lua_registernumber(L, n, i) (lua_pushnumber(L, (i)), lua_setglobal(L, (n)))
#define lua_registerint(L, n, i) (lua_pushinteger(L, (i)), lua_setglobal(L, (n)))
#define lua_pushtableboolean(L, k, v) (lua_pushstring(L, (k)), lua_pushboolean(L, (v)), lua_settable(L, -3))
@@ -250,7 +249,6 @@ void * tracer_alloc(void * ud, void * ptr, size_t osize, size_t nsize);
#else // defined(LUA)
#define luaInit()
#define LUA_INIT_THEMES_AND_WIDGETS()
#define LUA_LOAD_MODEL_SCRIPTS()
#endif // defined(LUA)