From 7d82f95df879250286c6cf230784bc0d217fda19 Mon Sep 17 00:00:00 2001 From: Scott Lahteine Date: Mon, 14 Apr 2025 16:45:12 -0500 Subject: [PATCH] =?UTF-8?q?=F0=9F=A9=B9=20Fix=20DWIN=5FCREALITY=5FLCD=5FST?= =?UTF-8?q?D=5FICONS?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/e3v2/common/dwin_set.h | 38 ++++++++++++++++++++------- Marlin/src/lcd/e3v2/jyersui/dwin.cpp | 16 +++++------ Marlin/src/lcd/e3v2/jyersui/dwin.h | 32 ++-------------------- 3 files changed, 38 insertions(+), 48 deletions(-) diff --git a/Marlin/src/lcd/e3v2/common/dwin_set.h b/Marlin/src/lcd/e3v2/common/dwin_set.h index 644efb40ba..f59bb74cd3 100644 --- a/Marlin/src/lcd/e3v2/common/dwin_set.h +++ b/Marlin/src/lcd/e3v2/common/dwin_set.h @@ -132,17 +132,7 @@ #define ICON_Printer_0 93 #define ICON_Box 200 #define ICON_Checkbox 201 -#define ICON_Fade 202 -#define ICON_Mesh 203 -#define ICON_Tilt 204 -#define ICON_Brightness 205 #define ICON_Probe 206 -#define ICON_AxisD 249 -#define ICON_AxisBR 250 -#define ICON_AxisTR 251 -#define ICON_AxisBL 252 -#define ICON_AxisTL 253 -#define ICON_AxisC 254 #define ICON_Folder ICON_More #define ICON_AdvSet ICON_Language @@ -162,3 +152,31 @@ #define ICON_FWRetZRaise ICON_MoveZ #define ICON_FWRecSpeed ICON_Setspeed #define ICON_FWRecExtra ICON_StepE + +#if DISABLED(DWIN_CREALITY_LCD_STD_ICONS) + // Index of custom icons should be >= CUSTOM_ICON_START + #define CUSTOM_ICON_START 200 + #define ICON_Checkbox_F ICON_Box + #define ICON_Checkbox_T ICON_Checkbox + #define ICON_Fade 202 + #define ICON_Mesh 203 + #define ICON_Tilt 204 + #define ICON_Brightness 205 + #define ICON_AxisD 249 + #define ICON_AxisBR 250 + #define ICON_AxisTR 251 + #define ICON_AxisBL 252 + #define ICON_AxisTL 253 + #define ICON_AxisC 254 +#else + #define ICON_Fade ICON_Version + #define ICON_Mesh ICON_Version + #define ICON_Tilt ICON_Version + #define ICON_Brightness ICON_Version + #define ICON_AxisD ICON_Axis + #define ICON_AxisBR ICON_Axis + #define ICON_AxisTR ICON_Axis + #define ICON_AxisBL ICON_Axis + #define ICON_AxisTL ICON_Axis + #define ICON_AxisC ICON_Axis +#endif diff --git a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp index 5811ac11bb..d582b96ed7 100644 --- a/Marlin/src/lcd/e3v2/jyersui/dwin.cpp +++ b/Marlin/src/lcd/e3v2/jyersui/dwin.cpp @@ -523,18 +523,18 @@ void JyersDWIN::drawMenuItem(const uint8_t row, const uint8_t icon/*=0*/, FSTR_P } void JyersDWIN::drawCheckbox(const uint8_t row, const bool value) { - #if ENABLED(DWIN_CREALITY_LCD_CUSTOM_ICONS) // Draw appropriate checkbox icon + #if DISABLED(DWIN_CREALITY_LCD_STD_ICONS) // Draw appropriate checkbox icon dwinIconShow(ICON, (value ? ICON_Checkbox_T : ICON_Checkbox_F), 226, MBASE(row) - 3); #else // Draw a basic checkbox using rectangles and lines dwinDrawRectangle(1, COLOR_BG_BLACK, 226, MBASE(row) - 3, 226 + 20, MBASE(row) - 3 + 20); - dwinDrawRectangle(0, COLOR_WHITE, 226, MBASE(row) - 3, 226 + 20, MBASE(row) - 3 + 20); + dwinDrawRectangle(0, COLOR_WHITE, 226, MBASE(row) - 3, 226 + 20, MBASE(row) - 3 + 20); if (value) { - dwinDrawLine(COLOR_CHECKBOX, 227, MBASE(row) - 3 + 11, 226 + 8, MBASE(row) - 3 + 17); - dwinDrawLine(COLOR_CHECKBOX, 227 + 8, MBASE(row) - 3 + 17, 226 + 19, MBASE(row) - 3 + 1); - dwinDrawLine(COLOR_CHECKBOX, 227, MBASE(row) - 3 + 12, 226 + 8, MBASE(row) - 3 + 18); - dwinDrawLine(COLOR_CHECKBOX, 227 + 8, MBASE(row) - 3 + 18, 226 + 19, MBASE(row) - 3 + 2); - dwinDrawLine(COLOR_CHECKBOX, 227, MBASE(row) - 3 + 13, 226 + 8, MBASE(row) - 3 + 19); - dwinDrawLine(COLOR_CHECKBOX, 227 + 8, MBASE(row) - 3 + 19, 226 + 19, MBASE(row) - 3 + 3); + dwinDrawLine(COLOR_CHECKBOX, 227, MBASE(row) - 3 + 11, 226 + 8, MBASE(row) - 3 + 17); + dwinDrawLine(COLOR_CHECKBOX, 227 + 8, MBASE(row) - 3 + 17, 226 + 19, MBASE(row) - 3 + 1); + dwinDrawLine(COLOR_CHECKBOX, 227, MBASE(row) - 3 + 12, 226 + 8, MBASE(row) - 3 + 18); + dwinDrawLine(COLOR_CHECKBOX, 227 + 8, MBASE(row) - 3 + 18, 226 + 19, MBASE(row) - 3 + 2); + dwinDrawLine(COLOR_CHECKBOX, 227, MBASE(row) - 3 + 13, 226 + 8, MBASE(row) - 3 + 19); + dwinDrawLine(COLOR_CHECKBOX, 227 + 8, MBASE(row) - 3 + 19, 226 + 19, MBASE(row) - 3 + 3); } #endif } diff --git a/Marlin/src/lcd/e3v2/jyersui/dwin.h b/Marlin/src/lcd/e3v2/jyersui/dwin.h index 48e413efbb..40c7490e30 100644 --- a/Marlin/src/lcd/e3v2/jyersui/dwin.h +++ b/Marlin/src/lcd/e3v2/jyersui/dwin.h @@ -26,7 +26,6 @@ */ #include "dwin_lcd.h" -#include "../common/dwin_set.h" #include "../common/dwin_font.h" #include "../common/dwin_color.h" #include "../common/encoder.h" @@ -35,7 +34,8 @@ #include "../../../inc/MarlinConfigPre.h" -//#define DWIN_CREALITY_LCD_CUSTOM_ICONS +#define DWIN_CREALITY_LCD_STD_ICONS +#include "../common/dwin_set.h" enum processID : uint8_t { Proc_Main, Proc_Print, Proc_Menu, Proc_Value, Proc_Option, @@ -120,34 +120,6 @@ enum menuID : uint8_t { ID_PreheatHotend }; -// Custom icons -#if ENABLED(DWIN_CREALITY_LCD_CUSTOM_ICONS) - // index of every custom icon should be >= CUSTOM_ICON_START - #define CUSTOM_ICON_START ICON_Checkbox_F - #define ICON_Checkbox_F 200 - #define ICON_Checkbox_T 201 - #define ICON_Fade 202 - #define ICON_Mesh 203 - #define ICON_Tilt 204 - #define ICON_Brightness 205 - #define ICON_AxisD 249 - #define ICON_AxisBR 250 - #define ICON_AxisTR 251 - #define ICON_AxisBL 252 - #define ICON_AxisTL 253 - #define ICON_AxisC 254 -#else - #define ICON_Fade ICON_Version - #define ICON_Mesh ICON_Version - #define ICON_Tilt ICON_Version - #define ICON_Brightness ICON_Version - #define ICON_AxisD ICON_Axis - #define ICON_AxisBR ICON_Axis - #define ICON_AxisTR ICON_Axis - #define ICON_AxisBL ICON_Axis - #define ICON_AxisTL ICON_Axis - #define ICON_AxisC ICON_Axis -#endif enum colorID : uint8_t { Default, White, Green, Cyan, Blue, Magenta, Red, Orange, Yellow, Brown, Black