diff --git a/radio/src/gui/colorlcd/CMakeLists.txt b/radio/src/gui/colorlcd/CMakeLists.txt index 7844a268e..af4c5cb7f 100644 --- a/radio/src/gui/colorlcd/CMakeLists.txt +++ b/radio/src/gui/colorlcd/CMakeLists.txt @@ -79,6 +79,10 @@ endmacro(add_gui_src) if(LUA) add_gui_src(standalone_lua.cpp) + set(SRC ${SRC} lua/widgets.cpp) +endif() + +if(LUA STREQUAL YES) add_gui_src(model_mixer_scripts.cpp) endif() @@ -102,10 +106,6 @@ if(GHOST) add_gui_src(radio_ghost_module_config.cpp) endif() -if(LUA STREQUAL YES) - set(SRC ${SRC} lua/widgets.cpp) -endif() - set(SRC ${SRC} storage/modelslist.cpp) option(WINDOWS_INSPECT_BORDERS "Draw bounding boxes around windows" OFF) diff --git a/radio/src/gui/colorlcd/menu_model.cpp b/radio/src/gui/colorlcd/menu_model.cpp index 9077b8b56..d22848a53 100644 --- a/radio/src/gui/colorlcd/menu_model.cpp +++ b/radio/src/gui/colorlcd/menu_model.cpp @@ -49,7 +49,7 @@ ModelMenu::ModelMenu(): addTab(new ModelGVarsPage()); addTab(new ModelLogicalSwitchesPage()); addTab(new SpecialFunctionsPage(g_model.customFn)); -#if defined(LUA) && defined(LUA_MODEL_SCRIPTS) +#if defined(LUA_MODEL_SCRIPTS) addTab(new ModelMixerScriptsPage()); #endif addTab(new ModelTelemetryPage()); diff --git a/radio/src/gui/colorlcd/view_text.cpp b/radio/src/gui/colorlcd/view_text.cpp index 4c8fedc1c..7fab655fe 100644 --- a/radio/src/gui/colorlcd/view_text.cpp +++ b/radio/src/gui/colorlcd/view_text.cpp @@ -63,7 +63,7 @@ void ViewTextWindow::buildBody(Window *window) // assume average characte is 10 pixels wide, round the string length to tens. // Font is not fixed width, so this is for the worst case... - const int maxLineLength = int(floor(window->width() / 10 / 10)) * 10 - 2; + const int maxLineLength = static_cast(window->width() / 10 / 10) * 10 - 2; window->setFocus(); FIL file; @@ -194,7 +194,7 @@ void ViewTextWindow::buildBody(Window *window) // assume average characte is 10 pixels wide, round the string length to tens. // Font is not fixed width, so this is for the worst case... - maxLineLength = int(floor(window->width() / 10 / 10)) * 10 - 2; + maxLineLength = static_cast(window->width() / 10 / 10) * 10 - 2; maxScreenLines = window->height() / (PAGE_LINE_HEIGHT + PAGE_LINE_SPACING); window->setFocus(); readLinesCount = 0; diff --git a/radio/src/opentx.cpp b/radio/src/opentx.cpp index 1cb82c9b6..9e65c0dbc 100644 --- a/radio/src/opentx.cpp +++ b/radio/src/opentx.cpp @@ -1499,11 +1499,12 @@ void opentxClose(uint8_t shutdown) //TODO: In fact we want only to empty the trash (private method) MainWindow::instance()->run(); - +#if defined(LUA) luaUnregisterWidgets(); luaClose(&lsWidgets); lsWidgets = 0; #endif +#endif #if defined(SDCARD) sdDone(); @@ -1516,7 +1517,7 @@ void opentxResume() TRACE("opentxResume"); sdMount(); -#if defined(COLORLCD) +#if defined(COLORLCD) && defined(LUA) // reload widgets luaInitThemesAndWidgets(); #endif