🩹 Fix DWIN_CREALITY_LCD_STD_ICONS

This commit is contained in:
Scott Lahteine 2025-04-14 16:45:12 -05:00
parent 69464790e2
commit 7d82f95df8
3 changed files with 38 additions and 48 deletions

View file

@ -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

View file

@ -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
}

View file

@ -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