0
0
Fork 0
mirror of https://github.com/MarlinFirmware/Marlin.git synced 2025-01-19 16:16:13 +00:00

🚸 MKS UI LVGL bed preheat presets (#22842)

This commit is contained in:
Malderin 2021-09-27 22:13:38 +03:00 committed by GitHub
parent 5dce8d0a84
commit 8f9e56afb9
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -132,8 +132,6 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {
uiCfg.curTempType = 0;
lv_obj_del(buttonAdd);
lv_obj_del(buttonDec);
disp_add_dec();
disp_ext_heart();
}
disp_temp_type();
@ -156,10 +154,16 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {
draw_return_ui();
break;
case ID_P_ABS:
thermalManager.setTargetHotend(PREHEAT_2_TEMP_HOTEND, 0);
if (uiCfg.curTempType == 0)
thermalManager.setTargetHotend(PREHEAT_2_TEMP_HOTEND, 0);
else if (uiCfg.curTempType == 1)
thermalManager.setTargetBed(PREHEAT_2_TEMP_BED);
break;
case ID_P_PLA:
thermalManager.setTargetHotend(PREHEAT_1_TEMP_HOTEND, 0);
if (uiCfg.curTempType == 0)
thermalManager.setTargetHotend(PREHEAT_1_TEMP_HOTEND, 0);
else if (uiCfg.curTempType == 1)
thermalManager.setTargetBed(PREHEAT_1_TEMP_BED);
break;
}
}
@ -180,6 +184,7 @@ void lv_draw_preHeat() {
buttonStep = lv_imgbtn_create(scr, nullptr, BTN_X_PIXEL + INTERVAL_V * 2, BTN_Y_PIXEL + INTERVAL_H + titleHeight, event_handler, ID_P_STEP);
if (uiCfg.curTempType == 0) disp_ext_heart();
if (uiCfg.curTempType == 1) disp_ext_heart();
#if HAS_ROTARY_ENCODER
if (gCfgItems.encoder_enable) {