Browse Source

🚸 Fix MKS LVGL UI temperature set interface (#22848, #22842)

vanilla_fb_2.0.x
Sola 3 years ago
committed by Scott Lahteine
parent
commit
b4c025a451
  1. 23
      Marlin/src/lcd/extui/mks_ui/draw_preHeat.cpp
  2. 1
      Marlin/src/lcd/extui/mks_ui/draw_ready_print.cpp

23
Marlin/src/lcd/extui/mks_ui/draw_preHeat.cpp

@ -124,24 +124,18 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {
else if (uiCfg.extruderIndex == 0) { else if (uiCfg.extruderIndex == 0) {
uiCfg.curTempType = TERN(HAS_HEATED_BED, 1, 0); uiCfg.curTempType = TERN(HAS_HEATED_BED, 1, 0);
} }
lv_obj_del(btn_pla);
lv_obj_del(btn_abs);
} }
else if (uiCfg.curTempType == 1) { else if (uiCfg.curTempType == 1) {
uiCfg.extruderIndex = 0; uiCfg.extruderIndex = 0;
uiCfg.curTempType = 0; uiCfg.curTempType = 0;
disp_add_dec(); lv_obj_del(buttonAdd);
disp_ext_heart(); lv_obj_del(buttonDec);
} }
disp_temp_type(); disp_temp_type();
break; break;
case ID_P_STEP:
switch (uiCfg.stepHeat) {
case 1: uiCfg.stepHeat = 5; break;
case 5: uiCfg.stepHeat = 10; break;
case 10: uiCfg.stepHeat = 1; break;
default: break;
}
disp_step_heat();
break;
case ID_P_OFF: case ID_P_OFF:
if (uiCfg.curTempType == 0) { if (uiCfg.curTempType == 0) {
thermalManager.setTargetHotend(0, uiCfg.extruderIndex); thermalManager.setTargetHotend(0, uiCfg.extruderIndex);
@ -160,10 +154,16 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {
draw_return_ui(); draw_return_ui();
break; break;
case ID_P_ABS: case ID_P_ABS:
if (uiCfg.curTempType == 0)
thermalManager.setTargetHotend(PREHEAT_2_TEMP_HOTEND, 0); thermalManager.setTargetHotend(PREHEAT_2_TEMP_HOTEND, 0);
else if (uiCfg.curTempType == 1)
thermalManager.setTargetBed(PREHEAT_2_TEMP_BED);
break; break;
case ID_P_PLA: case ID_P_PLA:
if (uiCfg.curTempType == 0)
thermalManager.setTargetHotend(PREHEAT_1_TEMP_HOTEND, 0); thermalManager.setTargetHotend(PREHEAT_1_TEMP_HOTEND, 0);
else if (uiCfg.curTempType == 1)
thermalManager.setTargetBed(PREHEAT_1_TEMP_BED);
break; break;
} }
} }
@ -184,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); 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 == 0) disp_ext_heart();
if (uiCfg.curTempType == 1) disp_ext_heart();
#if HAS_ROTARY_ENCODER #if HAS_ROTARY_ENCODER
if (gCfgItems.encoder_enable) { if (gCfgItems.encoder_enable) {

1
Marlin/src/lcd/extui/mks_ui/draw_ready_print.cpp

@ -98,6 +98,7 @@ void disp_det_ok() {
lv_obj_set_style(det_info, &det_style); lv_obj_set_style(det_info, &det_style);
lv_label_set_text(det_info, "det:ok"); lv_label_set_text(det_info, "det:ok");
} }
void disp_det_error() { void disp_det_error() {
det_style.text.color.full = 0xF800; det_style.text.color.full = 0xF800;
lv_obj_set_style(det_info, &det_style); lv_obj_set_style(det_info, &det_style);

Loading…
Cancel
Save