0
0
Fork 0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2025-01-22 17:52:57 +00:00

🚸 Move solo Case Light menu up

This commit is contained in:
Scott Lahteine 2024-08-21 17:34:51 -05:00
parent deb076b9cd
commit 21a604407d
2 changed files with 30 additions and 21 deletions

View file

@ -111,24 +111,24 @@
#if ENABLED(CASE_LIGHT_MENU)
#include "../../feature/caselight.h"
#define CASELIGHT_TOGGLE_ITEM() EDIT_ITEM(bool, MSG_CASE_LIGHT, (bool*)&caselight.on, caselight.update_enabled)
#if CASELIGHT_USES_BRIGHTNESS
void menu_case_light() {
START_MENU();
BACK_ITEM(MSG_CONFIGURATION);
EDIT_ITEM(percent, MSG_CASE_LIGHT_BRIGHTNESS, &caselight.brightness, 0, 255, caselight.update_brightness, true);
CASELIGHT_TOGGLE_ITEM();
EDIT_ITEM(bool, MSG_CASE_LIGHT, &caselight.on, caselight.update_enabled);
END_MENU();
}
#endif
#endif
void menu_led() {
START_MENU();
BACK_ITEM(MSG_MAIN_MENU);
#if ENABLED(LED_CONTROL_MENU)
void menu_led() {
START_MENU();
BACK_ITEM(MSG_MAIN_MENU);
#if ENABLED(LED_CONTROL_MENU)
if (TERN1(PSU_CONTROL, powerManager.psu_on)) {
editable.state = leds.lights_on;
EDIT_ITEM(bool, MSG_LEDS, &editable.state, leds.toggle);
@ -152,21 +152,22 @@ void menu_led() {
SUBMENU(MSG_NEO2_PRESETS, menu_leds2_presets);
#endif
SUBMENU(MSG_CUSTOM_LEDS, menu_led_custom);
#endif
//
// Set Case light on/off/brightness
//
#if ENABLED(CASE_LIGHT_MENU)
#if CASELIGHT_USES_BRIGHTNESS
if (caselight.has_brightness())
SUBMENU(MSG_CASE_LIGHT, menu_case_light);
else
//
// Set Case light on/off/brightness
//
#if ENABLED(CASE_LIGHT_MENU)
#if CASELIGHT_USES_BRIGHTNESS
if (caselight.has_brightness())
SUBMENU(MSG_CASE_LIGHT, menu_case_light);
else
#endif
EDIT_ITEM(bool, MSG_CASE_LIGHT, &caselight.on, caselight.update_enabled);
#endif
CASELIGHT_TOGGLE_ITEM();
#endif
END_MENU();
}
END_MENU();
}
#endif // LED_CONTROL_MENU
#endif // HAS_MARLINUI_MENU && LED_CONTROL_MENU

View file

@ -88,8 +88,12 @@ void menu_configuration();
void menu_info();
#endif
#if ANY(LED_CONTROL_MENU, CASE_LIGHT_MENU)
#if ENABLED(LED_CONTROL_MENU)
void menu_led();
#elif ALL(CASE_LIGHT_MENU, CASELIGHT_USES_BRIGHTNESS)
void menu_case_light();
#elif ENABLED(CASE_LIGHT_MENU)
#include "../../feature/caselight.h"
#endif
#if HAS_CUTTER
@ -371,8 +375,12 @@ void menu_main() {
SUBMENU(MSG_INFO_MENU, menu_info);
#endif
#if ANY(LED_CONTROL_MENU, CASE_LIGHT_MENU)
#if ENABLED(LED_CONTROL_MENU)
SUBMENU(MSG_LEDS, menu_led);
#elif ALL(CASE_LIGHT_MENU, CASELIGHT_USES_BRIGHTNESS)
SUBMENU(MSG_CASE_LIGHT, menu_case_light);
#elif ENABLED(CASE_LIGHT_MENU)
EDIT_ITEM(bool, MSG_CASE_LIGHT, &caselight.on, caselight.update_enabled);
#endif
//