From f9d6036526e44438bcc4f23fd479852dcd313ed7 Mon Sep 17 00:00:00 2001 From: Keith Bennett <13375512+thisiskeithb@users.noreply.github.com> Date: Sun, 19 Nov 2023 23:24:32 -0800 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=B8=20Fix=20more=20MarlinUI=20title=20?= =?UTF-8?q?centering=20(#26440)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Followup to #26339 --- Marlin/src/lcd/HD44780/marlinui_HD44780.cpp | 2 +- Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp | 2 +- Marlin/src/lcd/e3v2/creality/dwin.cpp | 14 +++++++++++++- Marlin/src/lcd/e3v2/marlinui/ui_common.cpp | 2 +- Marlin/src/lcd/e3v2/proui/dwin.h | 7 ------- 5 files changed, 16 insertions(+), 11 deletions(-) diff --git a/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp b/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp index 2564d4f96e23..155ae581f06a 100644 --- a/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp +++ b/Marlin/src/lcd/HD44780/marlinui_HD44780.cpp @@ -1179,7 +1179,7 @@ void MarlinUI::draw_status_screen() { int8_t llen = ftpl ? expand_u8str(estr, ftpl, itemIndex, itemStringC, itemStringF, n - vlen) : 0; bool mv_colon = false; - if (vlen) { + if (vlen && !center) { // Move the leading colon from the value to the label below mv_colon = (*vstr == ':'); // Shorter value, wider label diff --git a/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp b/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp index 4a6a6eec4722..b29653f7b01f 100644 --- a/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp +++ b/Marlin/src/lcd/TFTGLCD/marlinui_TFTGLCD.cpp @@ -983,7 +983,7 @@ void MarlinUI::draw_status_screen() { int8_t llen = ftpl ? expand_u8str(estr, ftpl, itemIndex, itemStringC, itemStringF, n - vlen) : 0; bool mv_colon = false; - if (vlen) { + if (vlen && !center) { // Move the leading colon from the value to the label below mv_colon = (*vstr == ':'); // Shorter value, wider label diff --git a/Marlin/src/lcd/e3v2/creality/dwin.cpp b/Marlin/src/lcd/e3v2/creality/dwin.cpp index f99a3d0a1ab0..c71ab8cff280 100644 --- a/Marlin/src/lcd/e3v2/creality/dwin.cpp +++ b/Marlin/src/lcd/e3v2/creality/dwin.cpp @@ -1384,7 +1384,19 @@ void hmiMoveDone(const AxisEnum axis) { dwinUpdateLCD(); return; } - LIMIT(hmiValues.offset_value, (PROBE_OFFSET_ZMIN) * 100, (PROBE_OFFSET_ZMAX) * 100); + + #if ENABLED(BABYSTEP_ZPROBE_OFFSET) && defined(PROBE_OFFSET_ZMIN) + #define _OFFSET_ZMIN (PROBE_OFFSET_ZMIN) + #else + #define _OFFSET_ZMIN -20 + #endif + #if ENABLED(BABYSTEP_ZPROBE_OFFSET) && defined(PROBE_OFFSET_ZMAX) + #define _OFFSET_ZMAX (PROBE_OFFSET_ZMAX) + #else + #define _OFFSET_ZMAX 20 + #endif + LIMIT(hmiValues.offset_value, _OFFSET_ZMIN * 100, _OFFSET_ZMAX * 100); + last_zoffset = dwin_zoffset; dwin_zoffset = hmiValues.offset_value / 100.0f; #if ANY(BABYSTEP_ZPROBE_OFFSET, JUST_BABYSTEP) diff --git a/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp b/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp index cc9d7b2e7b31..f9318c75b9bb 100644 --- a/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp +++ b/Marlin/src/lcd/e3v2/marlinui/ui_common.cpp @@ -324,7 +324,7 @@ void MarlinUI::draw_status_message(const bool blink) { int8_t vlen = vstr ? utf8_strlen(vstr) : 0; bool mv_colon = false; - if (vlen) { + if (vlen && !center) { // Move the leading colon from the value to the label below mv_colon = (*vstr == ':'); // Shorter value, wider label diff --git a/Marlin/src/lcd/e3v2/proui/dwin.h b/Marlin/src/lcd/e3v2/proui/dwin.h index 9c11cc49167f..a7e2cbccc6ea 100644 --- a/Marlin/src/lcd/e3v2/proui/dwin.h +++ b/Marlin/src/lcd/e3v2/proui/dwin.h @@ -39,13 +39,6 @@ #include "../../../feature/leds/leds.h" #endif -#if ANY(BABYSTEPPING, HAS_BED_PROBE) - #define HAS_ZOFFSET_ITEM 1 - #if !HAS_BED_PROBE - #define JUST_BABYSTEP 1 - #endif -#endif - namespace GET_LANG(LCD_LANGUAGE) { #define _MSG_PREHEAT(N) \ LSTR MSG_PREHEAT_##N = _UxGT("Preheat ") PREHEAT_## N ##_LABEL; \