FIX: no resource for the bitmap

JRIA: [STUDIO-13537]
Change-Id: Ib7a128e85d64fa1b4a0c67b3be5f5a3ccb3dd927
(cherry picked from commit aff46bd1378a18cb3d181dbf947bed870c0fa2d0)
This commit is contained in:
xin.zhang
2025-07-22 14:57:42 +08:00
committed by Noisyfox
parent 4b06a552b6
commit b6a44b5eb1

View File

@@ -1825,16 +1825,16 @@ AmsHumidityTipPopup::AmsHumidityTipPopup(wxWindow* parent)
} }
void AmsHumidityTipPopup::set_humidity_level(int level) void AmsHumidityTipPopup::set_humidity_level(int level)
{
if (0 < current_humidity_level && current_humidity_level < 6)
{ {
current_humidity_level = level; current_humidity_level = level;
if (current_humidity_level<= 0) {return;}
std::string mode_string = wxGetApp().dark_mode()?"_dark":"_light"; 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->SetBitmap(create_scaled_bitmap("hum_level" + std::to_string(current_humidity_level) + mode_string, this, 132));
curr_humidity_img->Refresh(); curr_humidity_img->Refresh();
curr_humidity_img->Update(); curr_humidity_img->Update();
} }
}
void AmsHumidityTipPopup::msw_rescale() void AmsHumidityTipPopup::msw_rescale()
{ {
@@ -1842,8 +1842,11 @@ void AmsHumidityTipPopup::msw_rescale()
close_img.msw_rescale(); close_img.msw_rescale();
// current humidity level image // current humidity level image
if (0 < current_humidity_level && current_humidity_level < 6)
{
std::string mode_string = wxGetApp().dark_mode() ? "_dark" : "_light"; 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->SetBitmap(create_scaled_bitmap("hum_level" + std::to_string(current_humidity_level) + mode_string, this, 132));
}
// the list // the list
humidity_level_list->msw_rescale(); humidity_level_list->msw_rescale();