From 1ff75d2aa593aa2f2d7d662af5b796d986797918 Mon Sep 17 00:00:00 2001 From: suchmememanyskill <38142618+suchmememanyskill@users.noreply.github.com> Date: Thu, 1 Feb 2024 18:10:40 +0100 Subject: [PATCH] Process feedback partially --- CYD-Klipper/src/core/device/ESP32-2432S028R.cpp | 7 +++++-- CYD-Klipper/src/core/device/ESP32-2432S028R.h | 1 - CYD-Klipper/src/core/screen_driver.h | 6 ------ CYD-Klipper/src/ui/panels/settings_panel.cpp | 4 ++++ 4 files changed, 9 insertions(+), 9 deletions(-) delete mode 100644 CYD-Klipper/src/core/device/ESP32-2432S028R.h diff --git a/CYD-Klipper/src/core/device/ESP32-2432S028R.cpp b/CYD-Klipper/src/core/device/ESP32-2432S028R.cpp index 59dfad1..851e401 100644 --- a/CYD-Klipper/src/core/device/ESP32-2432S028R.cpp +++ b/CYD-Klipper/src/core/device/ESP32-2432S028R.cpp @@ -1,4 +1,5 @@ -#include "ESP32-2432S028R.h" +#ifdef CYD_SCREEN_DRIVER_ESP32_2432S028R +#include "../screen_driver.h" #include #include @@ -267,4 +268,6 @@ void screen_setup() /*Initialize the graphics library */ LV_EVENT_GET_COMP_CHILD = lv_event_register_id(); set_color_scheme(); -} \ No newline at end of file +} + +#endif // CYD_SCREEN_DRIVER_ESP32_2432S028R \ No newline at end of file diff --git a/CYD-Klipper/src/core/device/ESP32-2432S028R.h b/CYD-Klipper/src/core/device/ESP32-2432S028R.h deleted file mode 100644 index 7b9637e..0000000 --- a/CYD-Klipper/src/core/device/ESP32-2432S028R.h +++ /dev/null @@ -1 +0,0 @@ -#pragma once \ No newline at end of file diff --git a/CYD-Klipper/src/core/screen_driver.h b/CYD-Klipper/src/core/screen_driver.h index 1e6380c..d1ca104 100644 --- a/CYD-Klipper/src/core/screen_driver.h +++ b/CYD-Klipper/src/core/screen_driver.h @@ -1,12 +1,6 @@ #pragma once // Adapted from https://github.com/xperiments-in/xtouch/blob/main/src/devices/2.8/screen.h -#ifdef CYD_SCREEN_DRIVER_ESP32_2432S028R - #include "device/ESP32-2432S028R.h" -#else - #error "No screen driver defined" -#endif - void touchscreen_calibrate(bool force = false); void screen_setBrightness(unsigned char brightness); void screen_timer_setup(); diff --git a/CYD-Klipper/src/ui/panels/settings_panel.cpp b/CYD-Klipper/src/ui/panels/settings_panel.cpp index 8b6972c..8568128 100644 --- a/CYD-Klipper/src/ui/panels/settings_panel.cpp +++ b/CYD-Klipper/src/ui/panels/settings_panel.cpp @@ -126,6 +126,7 @@ void settings_panel_init(lv_obj_t* panel){ create_settings_widget("Calibrate Touch", btn, panel); lv_obj_t * toggle = lv_switch_create(panel); + lv_obj_set_width(toggle, CYD_SCREEN_MIN_BUTTON_WIDTH_PX * 2); lv_obj_add_event_cb(toggle, invert_color_switch, LV_EVENT_VALUE_CHANGED, NULL); if (global_config.invertColors) @@ -135,6 +136,7 @@ void settings_panel_init(lv_obj_t* panel){ toggle = lv_switch_create(panel); + lv_obj_set_width(toggle, CYD_SCREEN_MIN_BUTTON_WIDTH_PX * 2); lv_obj_add_event_cb(toggle, light_mode_switch, LV_EVENT_VALUE_CHANGED, NULL); if (global_config.lightMode) @@ -176,6 +178,7 @@ void settings_panel_init(lv_obj_t* panel){ create_settings_widget("Wake Timeout", dropdown, panel); toggle = lv_switch_create(panel); + lv_obj_set_width(toggle, CYD_SCREEN_MIN_BUTTON_WIDTH_PX * 2); lv_obj_add_event_cb(toggle, rotate_screen_switch, LV_EVENT_VALUE_CHANGED, NULL); if (global_config.rotateScreen) @@ -184,6 +187,7 @@ void settings_panel_init(lv_obj_t* panel){ create_settings_widget("Rotate Screen", toggle, panel); toggle = lv_switch_create(panel); + lv_obj_set_width(toggle, CYD_SCREEN_MIN_BUTTON_WIDTH_PX * 2); lv_obj_add_event_cb(toggle, on_during_print_switch, LV_EVENT_VALUE_CHANGED, NULL); if (global_config.onDuringPrint)