Skip to content

Commit

Permalink
🚸 Fix MKS LVGL UI temperature set interface (MarlinFirmware#22848, Ma…
Browse files Browse the repository at this point in the history
  • Loading branch information
solawc authored and thinkyhead committed Oct 3, 2021
1 parent 604a01c commit b4c025a
Show file tree
Hide file tree
Showing 2 changed files with 15 additions and 13 deletions.
27 changes: 14 additions & 13 deletions Marlin/src/lcd/extui/mks_ui/draw_preHeat.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -124,24 +124,18 @@ static void event_handler(lv_obj_t *obj, lv_event_t event) {
else if (uiCfg.extruderIndex == 0) {
uiCfg.curTempType = TERN(HAS_HEATED_BED, 1, 0);
}
lv_obj_del(btn_pla);
lv_obj_del(btn_abs);
}
else if (uiCfg.curTempType == 1) {
uiCfg.extruderIndex = 0;
uiCfg.curTempType = 0;
disp_add_dec();
disp_ext_heart();
lv_obj_del(buttonAdd);
lv_obj_del(buttonDec);
}

disp_temp_type();
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:
if (uiCfg.curTempType == 0) {
thermalManager.setTargetHotend(0, uiCfg.extruderIndex);
Expand All @@ -160,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;
}
}
Expand All @@ -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);

if (uiCfg.curTempType == 0) disp_ext_heart();
if (uiCfg.curTempType == 1) disp_ext_heart();

#if HAS_ROTARY_ENCODER
if (gCfgItems.encoder_enable) {
Expand Down
1 change: 1 addition & 0 deletions Marlin/src/lcd/extui/mks_ui/draw_ready_print.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -98,6 +98,7 @@ void disp_det_ok() {
lv_obj_set_style(det_info, &det_style);
lv_label_set_text(det_info, "det:ok");
}

void disp_det_error() {
det_style.text.color.full = 0xF800;
lv_obj_set_style(det_info, &det_style);
Expand Down

0 comments on commit b4c025a

Please sign in to comment.