From b6a44b5eb1586948478ba6de7d474f8bfa3da71d Mon Sep 17 00:00:00 2001 From: "xin.zhang" Date: Tue, 22 Jul 2025 14:57:42 +0800 Subject: [PATCH] FIX: no resource for the bitmap JRIA: [STUDIO-13537] Change-Id: Ib7a128e85d64fa1b4a0c67b3be5f5a3ccb3dd927 (cherry picked from commit aff46bd1378a18cb3d181dbf947bed870c0fa2d0) --- src/slic3r/GUI/AmsMappingPopup.cpp | 23 +++++++++++++---------- 1 file changed, 13 insertions(+), 10 deletions(-) diff --git a/src/slic3r/GUI/AmsMappingPopup.cpp b/src/slic3r/GUI/AmsMappingPopup.cpp index b9fd9d6747..18c6bfbbbf 100644 --- a/src/slic3r/GUI/AmsMappingPopup.cpp +++ b/src/slic3r/GUI/AmsMappingPopup.cpp @@ -1826,14 +1826,14 @@ AmsHumidityTipPopup::AmsHumidityTipPopup(wxWindow* parent) void AmsHumidityTipPopup::set_humidity_level(int level) { - current_humidity_level = level; - if (current_humidity_level<= 0) {return;} - - std::string mode_string = wxGetApp().dark_mode()?"_dark":"_light"; - - curr_humidity_img->SetBitmap(create_scaled_bitmap("hum_level" + std::to_string(current_humidity_level) + mode_string, this, 132)); - curr_humidity_img->Refresh(); - curr_humidity_img->Update(); + if (0 < current_humidity_level && current_humidity_level < 6) + { + current_humidity_level = level; + std::string mode_string = wxGetApp().dark_mode()?"_dark":"_light"; + curr_humidity_img->SetBitmap(create_scaled_bitmap("hum_level" + std::to_string(current_humidity_level) + mode_string, this, 132)); + curr_humidity_img->Refresh(); + curr_humidity_img->Update(); + } } void AmsHumidityTipPopup::msw_rescale() @@ -1842,8 +1842,11 @@ void AmsHumidityTipPopup::msw_rescale() close_img.msw_rescale(); // current humidity level image - std::string mode_string = wxGetApp().dark_mode() ? "_dark" : "_light"; - curr_humidity_img->SetBitmap(create_scaled_bitmap("hum_level" + std::to_string(current_humidity_level) + mode_string, this, 132)); + if (0 < current_humidity_level && current_humidity_level < 6) + { + std::string mode_string = wxGetApp().dark_mode() ? "_dark" : "_light"; + curr_humidity_img->SetBitmap(create_scaled_bitmap("hum_level" + std::to_string(current_humidity_level) + mode_string, this, 132)); + } // the list humidity_level_list->msw_rescale();