diff --git a/src/eez/gui/assets.cpp b/src/eez/gui/assets.cpp index bdc49dd56..e5282d090 100644 --- a/src/eez/gui/assets.cpp +++ b/src/eez/gui/assets.cpp @@ -45,6 +45,8 @@ uint8_t *g_fontsData; uint8_t *g_bitmapsData; Colors *g_colorsData; +bool g_assetsLoaded; + #if OPTION_SDRAM void StyleList_fixPointers(StyleList &styleList) { styleList.first = (Style *)((uint8_t *)g_styles + (uint32_t)styleList.first); @@ -118,6 +120,8 @@ void decompressAssets() { #if OPTION_SDRAM fixPointers(); #endif + + g_assetsLoaded = true; } const Style *getStyle(int styleID) { @@ -194,4 +198,4 @@ const uint16_t *getColors() { } // namespace gui } // namespace eez -#endif \ No newline at end of file +#endif diff --git a/src/eez/gui/assets.h b/src/eez/gui/assets.h index e1f8dc83d..968a3fcb6 100644 --- a/src/eez/gui/assets.h +++ b/src/eez/gui/assets.h @@ -24,12 +24,14 @@ namespace eez { namespace gui { void decompressAssets(); - - extern Document *g_document; - extern StyleList *g_styles; - extern uint8_t *g_fontsData; - extern uint8_t *g_bitmapsData; - extern Colors *g_colorsData; + +extern Document *g_document; +extern StyleList *g_styles; +extern uint8_t *g_fontsData; +extern uint8_t *g_bitmapsData; +extern Colors *g_colorsData; + +extern bool g_assetsLoaded; const Style *getStyle(int styleID); const Style *getWidgetStyle(const Widget *widget); diff --git a/src/eez/modules/mcu/display.cpp b/src/eez/modules/mcu/display.cpp index a196e569a..f5235a410 100644 --- a/src/eez/modules/mcu/display.cpp +++ b/src/eez/modules/mcu/display.cpp @@ -54,9 +54,11 @@ static uint32_t g_themeColorsCount; static const uint16_t *g_colors; void onThemeChanged() { - g_themeColors = getThemeColors(psu::persist_conf::devConf2.selectedThemeIndex); - g_themeColorsCount = getThemeColorsCount(psu::persist_conf::devConf2.selectedThemeIndex); - g_colors = getColors(); + if (g_assetsLoaded) { + g_themeColors = getThemeColors(psu::persist_conf::devConf2.selectedThemeIndex); + g_themeColorsCount = getThemeColorsCount(psu::persist_conf::devConf2.selectedThemeIndex); + g_colors = getColors(); + } } void onLuminocityChanged() { @@ -357,4 +359,4 @@ void endBuffersDrawing() { } // namespace mcu } // namespace eez -#endif \ No newline at end of file +#endif diff --git a/src/third_party/stm32_r1b5/.settings/language.settings.xml b/src/third_party/stm32_r1b5/.settings/language.settings.xml index e05aaec6c..b010eb478 100644 --- a/src/third_party/stm32_r1b5/.settings/language.settings.xml +++ b/src/third_party/stm32_r1b5/.settings/language.settings.xml @@ -4,7 +4,7 @@ - +