From 8f9e56afb97ca6a40265b24fe90ac7b672050df9 Mon Sep 17 00:00:00 2001 From: Malderin <52313714+Malderin@users.noreply.github.com> Date: Mon, 27 Sep 2021 22:13:38 +0300 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=B8=20MKS=20UI=20LVGL=20bed=20preheat?= =?UTF-8?q?=20presets=20(#22842)?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- Marlin/src/lcd/extui/mks_ui/draw_preHeat.cpp | 13 +++++++++---- 1 file changed, 9 insertions(+), 4 deletions(-) diff --git a/Marlin/src/lcd/extui/mks_ui/draw_preHeat.cpp b/Marlin/src/lcd/extui/mks_ui/draw_preHeat.cpp index eb8799f1c4..6e9c88b60b 100644 --- a/Marlin/src/lcd/extui/mks_ui/draw_preHeat.cpp +++ b/Marlin/src/lcd/extui/mks_ui/draw_preHeat.cpp @@ -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) {