ENH: update humidity display for AMS-1

JIRA: [STUDIO-13195]
Change-Id: I7abcdf821b7ead2cf4a8605ecd95011e74f5dc6b
(cherry picked from commit 1c1d34ff7e3fea4492ba07e238ca171e28eb0a3b)
This commit is contained in:
xin.zhang
2025-07-18 11:42:25 +08:00
committed by Noisyfox
parent 2d215d75d2
commit 0721078177
15 changed files with 103 additions and 78 deletions

View File

@@ -1814,18 +1814,6 @@ AmsHumidityTipPopup::AmsHumidityTipPopup(wxWindow* parent)
wxGetApp().UpdateDarkUIWin(this);
}
void AmsHumidityTipPopup::paintEvent(wxPaintEvent& evt)
{
wxPaintDC dc(this);
render(dc);
}
void AmsHumidityTipPopup::OnDismiss() {}
bool AmsHumidityTipPopup::ProcessLeftDown(wxMouseEvent& event) {
return PopupWindow::ProcessLeftDown(event);
}
void AmsHumidityTipPopup::set_humidity_level(int level)
{
current_humidity_level = level;
@@ -1838,6 +1826,29 @@ void AmsHumidityTipPopup::set_humidity_level(int level)
curr_humidity_img->Update();
}
void AmsHumidityTipPopup::msw_rescale()
{
// close image
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));
// the list
humidity_level_list->msw_rescale();
// refresh
Refresh();
}
void AmsHumidityTipPopup::paintEvent(wxPaintEvent& evt)
{
wxPaintDC dc(this);
render(dc);
}
void AmsHumidityTipPopup::render(wxDC& dc)
{
#ifdef __WXMSW__
@@ -1870,6 +1881,8 @@ void AmsHumidityTipPopup::doRender(wxDC& dc)
dc.DrawRoundedRectangle(0, 0, GetSize().x, GetSize().y, 0);
}
AmsTutorialPopup::AmsTutorialPopup(wxWindow* parent)
:PopupWindow(parent, wxBORDER_NONE)
{
@@ -2669,7 +2682,19 @@ AmsHumidityLevelList::AmsHumidityLevelList(wxWindow* parent)
void AmsHumidityLevelList::msw_rescale()
{
background_img.msw_rescale();
for (int i = 0; i < hum_level_img_light.size(); i++)
{
hum_level_img_light[i].msw_rescale();
}
for (int i = 0; i < hum_level_img_dark.size(); i++)
{
hum_level_img_dark[i].msw_rescale();
}
Refresh();
}
void AmsHumidityLevelList::paintEvent(wxPaintEvent& evt)