Ender 3 V2 Status Line (#21369)

Co-authored-by: Scott Lahteine <thinkyhead@users.noreply.github.com>
This commit is contained in:
Miguel Risco-Castillo
2021-03-24 10:12:57 -05:00
committed by GitHub
parent d172c71376
commit 930752d46e
20 changed files with 66 additions and 47 deletions

View File

@ -402,7 +402,7 @@ void Draw_Title(const __FlashStringHelper * title) {
}
void Clear_Menu_Area() {
DWIN_Draw_Rectangle(1, Color_Bg_Black, 0, 31, DWIN_WIDTH, STATUS_Y);
DWIN_Draw_Rectangle(1, Color_Bg_Black, 0, 31, DWIN_WIDTH, STATUS_Y - 1);
}
void Clear_Main_Window() {
@ -3794,4 +3794,11 @@ void DWIN_CompletedLeveling() {
if (checkkey == Leveling) Goto_MainMenu();
}
void DWIN_StatusChanged(const char *text) {
DWIN_Draw_Rectangle(1, Color_Bg_Blue, 0, STATUS_Y, DWIN_WIDTH, STATUS_Y + 20);
const int8_t x = _MAX(0U, DWIN_WIDTH - strlen_P(text) * MENU_CHR_W) / 2;
DWIN_Draw_String(false, false, font8x16, Color_White, Color_Bg_Blue, x, STATUS_Y + 2, F(text));
DWIN_UpdateLCD();
}
#endif // DWIN_CREALITY_LCD

View File

@ -377,6 +377,7 @@ void HMI_Init();
void DWIN_Update();
void EachMomentUpdate();
void DWIN_HandleScreen();
void DWIN_StatusChanged(const char *text);
inline void DWIN_StartHoming() { HMI_flag.home_flag = true; }