Skip to content

Commit 7d82f95

Browse files
committed
🩹 Fix DWIN_CREALITY_LCD_STD_ICONS
1 parent 6946479 commit 7d82f95

File tree

3 files changed

+38
-48
lines changed

3 files changed

+38
-48
lines changed

Marlin/src/lcd/e3v2/common/dwin_set.h

Lines changed: 28 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -132,17 +132,7 @@
132132
#define ICON_Printer_0 93
133133
#define ICON_Box 200
134134
#define ICON_Checkbox 201
135-
#define ICON_Fade 202
136-
#define ICON_Mesh 203
137-
#define ICON_Tilt 204
138-
#define ICON_Brightness 205
139135
#define ICON_Probe 206
140-
#define ICON_AxisD 249
141-
#define ICON_AxisBR 250
142-
#define ICON_AxisTR 251
143-
#define ICON_AxisBL 252
144-
#define ICON_AxisTL 253
145-
#define ICON_AxisC 254
146136

147137
#define ICON_Folder ICON_More
148138
#define ICON_AdvSet ICON_Language
@@ -162,3 +152,31 @@
162152
#define ICON_FWRetZRaise ICON_MoveZ
163153
#define ICON_FWRecSpeed ICON_Setspeed
164154
#define ICON_FWRecExtra ICON_StepE
155+
156+
#if DISABLED(DWIN_CREALITY_LCD_STD_ICONS)
157+
// Index of custom icons should be >= CUSTOM_ICON_START
158+
#define CUSTOM_ICON_START 200
159+
#define ICON_Checkbox_F ICON_Box
160+
#define ICON_Checkbox_T ICON_Checkbox
161+
#define ICON_Fade 202
162+
#define ICON_Mesh 203
163+
#define ICON_Tilt 204
164+
#define ICON_Brightness 205
165+
#define ICON_AxisD 249
166+
#define ICON_AxisBR 250
167+
#define ICON_AxisTR 251
168+
#define ICON_AxisBL 252
169+
#define ICON_AxisTL 253
170+
#define ICON_AxisC 254
171+
#else
172+
#define ICON_Fade ICON_Version
173+
#define ICON_Mesh ICON_Version
174+
#define ICON_Tilt ICON_Version
175+
#define ICON_Brightness ICON_Version
176+
#define ICON_AxisD ICON_Axis
177+
#define ICON_AxisBR ICON_Axis
178+
#define ICON_AxisTR ICON_Axis
179+
#define ICON_AxisBL ICON_Axis
180+
#define ICON_AxisTL ICON_Axis
181+
#define ICON_AxisC ICON_Axis
182+
#endif

Marlin/src/lcd/e3v2/jyersui/dwin.cpp

Lines changed: 8 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -523,18 +523,18 @@ void JyersDWIN::drawMenuItem(const uint8_t row, const uint8_t icon/*=0*/, FSTR_P
523523
}
524524

525525
void JyersDWIN::drawCheckbox(const uint8_t row, const bool value) {
526-
#if ENABLED(DWIN_CREALITY_LCD_CUSTOM_ICONS) // Draw appropriate checkbox icon
526+
#if DISABLED(DWIN_CREALITY_LCD_STD_ICONS) // Draw appropriate checkbox icon
527527
dwinIconShow(ICON, (value ? ICON_Checkbox_T : ICON_Checkbox_F), 226, MBASE(row) - 3);
528528
#else // Draw a basic checkbox using rectangles and lines
529529
dwinDrawRectangle(1, COLOR_BG_BLACK, 226, MBASE(row) - 3, 226 + 20, MBASE(row) - 3 + 20);
530-
dwinDrawRectangle(0, COLOR_WHITE, 226, MBASE(row) - 3, 226 + 20, MBASE(row) - 3 + 20);
530+
dwinDrawRectangle(0, COLOR_WHITE, 226, MBASE(row) - 3, 226 + 20, MBASE(row) - 3 + 20);
531531
if (value) {
532-
dwinDrawLine(COLOR_CHECKBOX, 227, MBASE(row) - 3 + 11, 226 + 8, MBASE(row) - 3 + 17);
533-
dwinDrawLine(COLOR_CHECKBOX, 227 + 8, MBASE(row) - 3 + 17, 226 + 19, MBASE(row) - 3 + 1);
534-
dwinDrawLine(COLOR_CHECKBOX, 227, MBASE(row) - 3 + 12, 226 + 8, MBASE(row) - 3 + 18);
535-
dwinDrawLine(COLOR_CHECKBOX, 227 + 8, MBASE(row) - 3 + 18, 226 + 19, MBASE(row) - 3 + 2);
536-
dwinDrawLine(COLOR_CHECKBOX, 227, MBASE(row) - 3 + 13, 226 + 8, MBASE(row) - 3 + 19);
537-
dwinDrawLine(COLOR_CHECKBOX, 227 + 8, MBASE(row) - 3 + 19, 226 + 19, MBASE(row) - 3 + 3);
532+
dwinDrawLine(COLOR_CHECKBOX, 227, MBASE(row) - 3 + 11, 226 + 8, MBASE(row) - 3 + 17);
533+
dwinDrawLine(COLOR_CHECKBOX, 227 + 8, MBASE(row) - 3 + 17, 226 + 19, MBASE(row) - 3 + 1);
534+
dwinDrawLine(COLOR_CHECKBOX, 227, MBASE(row) - 3 + 12, 226 + 8, MBASE(row) - 3 + 18);
535+
dwinDrawLine(COLOR_CHECKBOX, 227 + 8, MBASE(row) - 3 + 18, 226 + 19, MBASE(row) - 3 + 2);
536+
dwinDrawLine(COLOR_CHECKBOX, 227, MBASE(row) - 3 + 13, 226 + 8, MBASE(row) - 3 + 19);
537+
dwinDrawLine(COLOR_CHECKBOX, 227 + 8, MBASE(row) - 3 + 19, 226 + 19, MBASE(row) - 3 + 3);
538538
}
539539
#endif
540540
}

Marlin/src/lcd/e3v2/jyersui/dwin.h

Lines changed: 2 additions & 30 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,6 @@
2626
*/
2727

2828
#include "dwin_lcd.h"
29-
#include "../common/dwin_set.h"
3029
#include "../common/dwin_font.h"
3130
#include "../common/dwin_color.h"
3231
#include "../common/encoder.h"
@@ -35,7 +34,8 @@
3534

3635
#include "../../../inc/MarlinConfigPre.h"
3736

38-
//#define DWIN_CREALITY_LCD_CUSTOM_ICONS
37+
#define DWIN_CREALITY_LCD_STD_ICONS
38+
#include "../common/dwin_set.h"
3939

4040
enum processID : uint8_t {
4141
Proc_Main, Proc_Print, Proc_Menu, Proc_Value, Proc_Option,
@@ -120,34 +120,6 @@ enum menuID : uint8_t {
120120
ID_PreheatHotend
121121
};
122122

123-
// Custom icons
124-
#if ENABLED(DWIN_CREALITY_LCD_CUSTOM_ICONS)
125-
// index of every custom icon should be >= CUSTOM_ICON_START
126-
#define CUSTOM_ICON_START ICON_Checkbox_F
127-
#define ICON_Checkbox_F 200
128-
#define ICON_Checkbox_T 201
129-
#define ICON_Fade 202
130-
#define ICON_Mesh 203
131-
#define ICON_Tilt 204
132-
#define ICON_Brightness 205
133-
#define ICON_AxisD 249
134-
#define ICON_AxisBR 250
135-
#define ICON_AxisTR 251
136-
#define ICON_AxisBL 252
137-
#define ICON_AxisTL 253
138-
#define ICON_AxisC 254
139-
#else
140-
#define ICON_Fade ICON_Version
141-
#define ICON_Mesh ICON_Version
142-
#define ICON_Tilt ICON_Version
143-
#define ICON_Brightness ICON_Version
144-
#define ICON_AxisD ICON_Axis
145-
#define ICON_AxisBR ICON_Axis
146-
#define ICON_AxisTR ICON_Axis
147-
#define ICON_AxisBL ICON_Axis
148-
#define ICON_AxisTL ICON_Axis
149-
#define ICON_AxisC ICON_Axis
150-
#endif
151123

152124
enum colorID : uint8_t {
153125
Default, White, Green, Cyan, Blue, Magenta, Red, Orange, Yellow, Brown, Black

0 commit comments

Comments
 (0)