From 8530f3923b4356c1e3288633cb5659a646ac91c3 Mon Sep 17 00:00:00 2001 From: alexgrach Date: Thu, 26 Jan 2023 22:33:07 +0300 Subject: [PATCH 1/2] Moved buttons colors to tft_color.h --- Marlin/src/lcd/tft/tft_color.h | 13 +++++++++++++ Marlin/src/lcd/tft/ui_1024x600.cpp | 5 ----- Marlin/src/lcd/tft/ui_320x240.cpp | 5 ----- Marlin/src/lcd/tft/ui_480x320.cpp | 5 ----- 4 files changed, 13 insertions(+), 15 deletions(-) diff --git a/Marlin/src/lcd/tft/tft_color.h b/Marlin/src/lcd/tft/tft_color.h index a8668179e579..07518028aa80 100644 --- a/Marlin/src/lcd/tft/tft_color.h +++ b/Marlin/src/lcd/tft/tft_color.h @@ -178,3 +178,16 @@ #ifndef COLOR_KILL_SCREEN_TEXT #define COLOR_KILL_SCREEN_TEXT COLOR_WHITE #endif + +#ifndef E_BTN_COLOR + #define E_BTN_COLOR COLOR_YELLOW +#endif +#ifndef X_BTN_COLOR + #define X_BTN_COLOR COLOR_CORAL_RED +#endif +#ifndef Y_BTN_COLOR + #define Y_BTN_COLOR COLOR_VIVID_GREEN +#endif +#ifndef Z_BTN_COLOR + #define Z_BTN_COLOR COLOR_LIGHT_BLUE +#endif diff --git a/Marlin/src/lcd/tft/ui_1024x600.cpp b/Marlin/src/lcd/tft/ui_1024x600.cpp index 363e8eaf9925..771f12d89897 100644 --- a/Marlin/src/lcd/tft/ui_1024x600.cpp +++ b/Marlin/src/lcd/tft/ui_1024x600.cpp @@ -592,11 +592,6 @@ struct MotionAxisState { MotionAxisState motionAxisState; -#define E_BTN_COLOR COLOR_YELLOW -#define X_BTN_COLOR COLOR_CORAL_RED -#define Y_BTN_COLOR COLOR_VIVID_GREEN -#define Z_BTN_COLOR COLOR_LIGHT_BLUE - #define BTN_WIDTH 64 #define BTN_HEIGHT 52 #define X_MARGIN 20 diff --git a/Marlin/src/lcd/tft/ui_320x240.cpp b/Marlin/src/lcd/tft/ui_320x240.cpp index fa433645d7b2..76cce4dad14e 100644 --- a/Marlin/src/lcd/tft/ui_320x240.cpp +++ b/Marlin/src/lcd/tft/ui_320x240.cpp @@ -674,11 +674,6 @@ struct MotionAxisState { MotionAxisState motionAxisState; -#define E_BTN_COLOR COLOR_YELLOW -#define X_BTN_COLOR COLOR_CORAL_RED -#define Y_BTN_COLOR COLOR_VIVID_GREEN -#define Z_BTN_COLOR COLOR_LIGHT_BLUE - #define BTN_WIDTH 48 #define BTN_HEIGHT 39 #define X_MARGIN 15 diff --git a/Marlin/src/lcd/tft/ui_480x320.cpp b/Marlin/src/lcd/tft/ui_480x320.cpp index 5bf50a581843..c4395460d569 100644 --- a/Marlin/src/lcd/tft/ui_480x320.cpp +++ b/Marlin/src/lcd/tft/ui_480x320.cpp @@ -573,11 +573,6 @@ struct MotionAxisState { MotionAxisState motionAxisState; -#define E_BTN_COLOR COLOR_YELLOW -#define X_BTN_COLOR COLOR_CORAL_RED -#define Y_BTN_COLOR COLOR_VIVID_GREEN -#define Z_BTN_COLOR COLOR_LIGHT_BLUE - #define BTN_WIDTH 64 #define BTN_HEIGHT 52 #define X_MARGIN 20 From 36b5816e539e27d689f4958e40512eeb739b5931 Mon Sep 17 00:00:00 2001 From: alexgrach Date: Fri, 27 Jan 2023 20:57:54 +0300 Subject: [PATCH 2/2] Update Conditionals_LCD.h --- Marlin/src/inc/Conditionals_LCD.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/Marlin/src/inc/Conditionals_LCD.h b/Marlin/src/inc/Conditionals_LCD.h index c4926edd51c7..bdf95007c7f4 100644 --- a/Marlin/src/inc/Conditionals_LCD.h +++ b/Marlin/src/inc/Conditionals_LCD.h @@ -1621,9 +1621,9 @@ #endif #if ANY(HAS_UI_320x240, HAS_UI_480x320, HAS_UI_480x272) #if ENABLED(TFT_COLOR_UI_PORTRAIT) - #define LCD_HEIGHT TERN(TOUCH_SCREEN, 6, 7) // Fewer lines with touch buttons onscreen - #else #define LCD_HEIGHT TERN(TOUCH_SCREEN, 8, 9) // Fewer lines with touch buttons onscreen + #else + #define LCD_HEIGHT TERN(TOUCH_SCREEN, 6, 7) // Fewer lines with touch buttons onscreen #endif #elif HAS_UI_1024x600 #define LCD_HEIGHT TERN(TOUCH_SCREEN, 12, 13) // Fewer lines with touch buttons onscreen