diff --git a/Marlin/src/lcd/extui/lib/mks_ui/SPI_TFT.h b/Marlin/src/lcd/extui/lib/mks_ui/SPI_TFT.h index 696bc1697..f3be3dc0b 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/SPI_TFT.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/SPI_TFT.h @@ -21,7 +21,7 @@ */ #pragma once -#include "../../inc/MarlinConfigPre.h" +#include "../../../../inc/MarlinConfigPre.h" #if HAS_TFT_LVGL_UI diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_about.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_about.cpp index 34168574e..01f64e8fc 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_about.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_about.cpp @@ -50,20 +50,7 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { void lv_draw_about(void) { scr = lv_screen_create(ABOUT_UI); - - // Create an Image button - lv_obj_t *buttonBack = lv_imgbtn_create(scr, "F:/bmp_return.bin", BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_A_RETURN); - #if HAS_ROTARY_ENCODER - if (gCfgItems.encoder_enable) lv_group_add_obj(g, buttonBack); - #endif - - // Create a label on the image button - lv_obj_t *label_Back = lv_label_create_empty(buttonBack); - - if (gCfgItems.multiple_language) { - lv_label_set_text(label_Back, common_menu.text_back); - lv_obj_align(label_Back, buttonBack, LV_ALIGN_IN_BOTTOM_MID, 0, BUTTON_TEXT_Y_OFFSET); - } + lv_big_button_create(scr, "F:/bmp_return.bin", common_menu.text_back, BTN_X_PIXEL * 3 + INTERVAL_V * 4, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_A_RETURN); //fw_version = lv_label_create(scr, SHORT_BUILD_VERSION); //lv_obj_align(fw_version, nullptr, LV_ALIGN_CENTER, 0, -60); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp index 67ed24d8c..0a36b09ce 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_dialog.cpp @@ -214,7 +214,7 @@ void lv_draw_dialog(uint8_t type) { uiCfg.dialogType = type; scr = lv_screen_create(DIALOG_UI); - lv_obj_t *labelDialog = lv_label_create_empty(scr); + lv_obj_t *labelDialog = lv_label_create(scr, ""); if (DIALOG_IS(TYPE_FINISH_PRINT, PAUSE_MESSAGE_RESUME)) { btnOk = lv_button_btn_create(scr, BTN_OK_X + 90, BTN_OK_Y, 100, 50, btn_ok_event_cb); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp index cfd06cf09..f513ea4d0 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_print_file.cpp @@ -208,11 +208,6 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) { void lv_draw_print_file(void) { //uint8_t i; uint8_t file_count; - if (disp_state_stack._disp_state[disp_state_stack._disp_index] != PRINT_FILE_UI) { - disp_state_stack._disp_index++; - disp_state_stack._disp_state[disp_state_stack._disp_index] = PRINT_FILE_UI; - } - disp_state = PRINT_FILE_UI; curDirLever = 0; dir_offset[curDirLever].curPage = 0; @@ -252,7 +247,7 @@ static char test_public_buf_l[40]; void disp_gcode_icon(uint8_t file_num) { uint8_t i; - scr = lv_screen_create(MAIN_UI, ""); + scr = lv_screen_create(PRINT_FILE_UI, ""); // Create image buttons buttonPageUp = lv_imgbtn_create(scr, "F:/bmp_pageUp.bin", OTHER_BTN_XPIEL * 3 + INTERVAL_V * 4, titleHeight, event_handler, ID_P_UP); diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp b/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp index 50c49999a..c7f5f418f 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.cpp @@ -1640,7 +1640,6 @@ lv_obj_t* lv_screen_create(DISP_STATE newScreenType, const char* title) { disp_state_stack._disp_state[disp_state_stack._disp_index] = newScreenType; } disp_state = newScreenType; - lv_refr_now(lv_refr_get_disp_refreshing()); // title lv_obj_t *titleLabel = nullptr; @@ -1651,18 +1650,22 @@ lv_obj_t* lv_screen_create(DISP_STATE newScreenType, const char* title) { if (titleLabel) lv_obj_set_style(titleLabel, &tft_style_label_rel); + lv_refr_now(lv_refr_get_disp_refreshing()); + return scr; } // Create an empty label lv_obj_t* lv_label_create_empty(lv_obj_t *par) { - return lv_label_create(par, (lv_obj_t*)nullptr); + lv_obj_t *label = lv_label_create(par, (lv_obj_t*)nullptr); + return label; } // Create a label with style and text lv_obj_t* lv_label_create(lv_obj_t *par, const char *text) { lv_obj_t *label = lv_label_create_empty(par); if (text) lv_label_set_text(label, text); + lv_obj_set_style(label, &tft_style_label_rel); return label; } diff --git a/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h b/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h index 3e3a4073d..eb54b3e4e 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/draw_ui.h @@ -86,7 +86,7 @@ #include "draw_wifi_tips.h" #endif -#include "../../inc/MarlinConfigPre.h" +#include "../../../../inc/MarlinConfigPre.h" #define FILE_SYS_USB 0 #define FILE_SYS_SD 1 diff --git a/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp b/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp index 2f1ec48b4..26f630176 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp +++ b/Marlin/src/lcd/extui/lib/mks_ui/tft_lvgl_configuration.cpp @@ -43,7 +43,7 @@ #include "../../../../MarlinCore.h" #include "../../../../inc/MarlinConfig.h" -#include HAL_PATH(../../HAL, tft/xpt2046.h) +#include HAL_PATH(../../../../HAL, tft/xpt2046.h) #include "../../../marlinui.h" XPT2046 touch; diff --git a/Marlin/src/lcd/extui/lib/mks_ui/wifi_module.h b/Marlin/src/lcd/extui/lib/mks_ui/wifi_module.h index 0b402a3ad..656e440bc 100644 --- a/Marlin/src/lcd/extui/lib/mks_ui/wifi_module.h +++ b/Marlin/src/lcd/extui/lib/mks_ui/wifi_module.h @@ -25,7 +25,7 @@ extern "C" { /* C-declarations for C++ */ #endif -#include "../../inc/MarlinConfigPre.h" +#include "../../../../inc/MarlinConfigPre.h" #include #include