FIX: rescale of camera icons when alter resolution

Change-Id: I45a59e7ec48699bfd249c7bb75cd8b70edaf0687
This commit is contained in:
tao.jin 2022-12-12 16:29:42 +08:00 committed by Lane.Wei
parent db94f39f78
commit ebec542112
3 changed files with 26 additions and 24 deletions

View file

@ -414,7 +414,10 @@ CameraItem::CameraItem(wxWindow *parent, std::string normal, std::string hover)
CameraItem::~CameraItem() {} CameraItem::~CameraItem() {}
void CameraItem::msw_rescale() {} void CameraItem::msw_rescale() {
m_bitmap_normal.msw_rescale();
m_bitmap_hover.msw_rescale();
}
void CameraItem::on_enter_win(wxMouseEvent &evt) void CameraItem::on_enter_win(wxMouseEvent &evt)
{ {

View file

@ -256,7 +256,7 @@ wxBoxSizer *StatusBasePanel::create_monitoring_page()
m_bitmap_sdcard_img->SetToolTip(_L("SD Card")); m_bitmap_sdcard_img->SetToolTip(_L("SD Card"));
m_bitmap_timelapse_img->SetToolTip(_L("Timelapse")); m_bitmap_timelapse_img->SetToolTip(_L("Timelapse"));
m_bitmap_recording_img->SetToolTip(_L("Video")); m_bitmap_recording_img->SetToolTip(_L("Video"));
m_bitmap_vcamera_img->SetToolTip(_L("Virtual Camera")); m_bitmap_vcamera_img->SetToolTip(_L("Go Live"));
m_setting_button->SetToolTip(_L("Camera Setting")); m_setting_button->SetToolTip(_L("Camera Setting"));
bSizer_monitoring_title->Add(m_bitmap_sdcard_img, 0, wxALIGN_CENTER_VERTICAL | wxALL, FromDIP(5)); bSizer_monitoring_title->Add(m_bitmap_sdcard_img, 0, wxALIGN_CENTER_VERTICAL | wxALL, FromDIP(5));
@ -2938,18 +2938,16 @@ void StatusPanel::set_hold_count(int& count)
count = COMMAND_TIMEOUT; count = COMMAND_TIMEOUT;
} }
void StatusPanel::on_sys_color_changed() void StatusPanel::rescale_camera_icons()
{ {
m_button_abort->msw_rescale(); m_setting_button->msw_rescale();
m_bitmap_speed.msw_rescale();
m_bitmap_speed_active.msw_rescale();
m_switch_speed->SetImages(m_bitmap_speed, m_bitmap_speed);
m_ams_control->msw_rescale();
m_bitmap_vcamera_on.msw_rescale(); m_bitmap_vcamera_on.msw_rescale();
m_bitmap_vcamera_off.msw_rescale(); m_bitmap_vcamera_off.msw_rescale();
if (m_media_play_ctrl->IsStreaming()) { if (m_media_play_ctrl->IsStreaming()) {
m_bitmap_vcamera_img->SetBitmap(m_bitmap_vcamera_on.bmp()); m_bitmap_vcamera_img->SetBitmap(m_bitmap_vcamera_on.bmp());
} else { }
else {
m_bitmap_vcamera_img->SetBitmap(m_bitmap_vcamera_off.bmp()); m_bitmap_vcamera_img->SetBitmap(m_bitmap_vcamera_off.bmp());
} }
@ -2959,14 +2957,11 @@ void StatusPanel::on_sys_color_changed()
m_bitmap_sdcard_state_normal.msw_rescale(); m_bitmap_sdcard_state_normal.msw_rescale();
if (obj->get_sdcard_state() == MachineObject::SdcardState::NO_SDCARD) { if (obj->get_sdcard_state() == MachineObject::SdcardState::NO_SDCARD) {
m_bitmap_sdcard_img->SetBitmap(m_bitmap_sdcard_state_no.bmp()); m_bitmap_sdcard_img->SetBitmap(m_bitmap_sdcard_state_no.bmp());
} } else if (obj->get_sdcard_state() == MachineObject::SdcardState::HAS_SDCARD_NORMAL) {
else if (obj->get_sdcard_state() == MachineObject::SdcardState::HAS_SDCARD_NORMAL) {
m_bitmap_sdcard_img->SetBitmap(m_bitmap_sdcard_state_normal.bmp()); m_bitmap_sdcard_img->SetBitmap(m_bitmap_sdcard_state_normal.bmp());
} } else if (obj->get_sdcard_state() == MachineObject::SdcardState::HAS_SDCARD_ABNORMAL) {
else if (obj->get_sdcard_state() == MachineObject::SdcardState::HAS_SDCARD_ABNORMAL) {
m_bitmap_sdcard_img->SetBitmap(m_bitmap_sdcard_state_abnormal.bmp()); m_bitmap_sdcard_img->SetBitmap(m_bitmap_sdcard_state_abnormal.bmp());
} } else {
else {
m_bitmap_sdcard_img->SetBitmap(m_bitmap_sdcard_state_normal.bmp()); m_bitmap_sdcard_img->SetBitmap(m_bitmap_sdcard_state_normal.bmp());
} }
@ -2987,6 +2982,16 @@ void StatusPanel::on_sys_color_changed()
} }
} }
void StatusPanel::on_sys_color_changed()
{
m_button_abort->msw_rescale();
m_bitmap_speed.msw_rescale();
m_bitmap_speed_active.msw_rescale();
m_switch_speed->SetImages(m_bitmap_speed, m_bitmap_speed);
m_ams_control->msw_rescale();
rescale_camera_icons();
}
void StatusPanel::msw_rescale() void StatusPanel::msw_rescale()
{ {
init_bitmaps(); init_bitmaps();
@ -3015,15 +3020,6 @@ void StatusPanel::msw_rescale()
slice_info_list[i]->msw_rescale(); slice_info_list[i]->msw_rescale();
} }
//m_bitmap_camera_img->SetBitmap(m_bitmap_camera);
//m_bitmap_camera_img->SetMinSize(wxSize(FromDIP(32), FromDIP(18)));
m_bitmap_timelapse_img->SetMinSize(wxSize(38, 24));
m_bitmap_recording_img->SetMinSize(wxSize(38, 24));
m_bitmap_vcamera_img->SetMinSize(wxSize(38, 24));
m_setting_button->SetMinSize(wxSize(38, 24));
m_bitmap_sdcard_img->SetMinSize(wxSize(FromDIP(38), FromDIP(24)));
m_bpButton_xy->Rescale(); m_bpButton_xy->Rescale();
m_tempCtrl_nozzle->SetMinSize(TEMP_CTRL_MIN_SIZE); m_tempCtrl_nozzle->SetMinSize(TEMP_CTRL_MIN_SIZE);
m_tempCtrl_nozzle->Rescale(); m_tempCtrl_nozzle->Rescale();
@ -3063,6 +3059,8 @@ void StatusPanel::msw_rescale()
m_options_btn->SetMinSize(wxSize(-1, FromDIP(26))); m_options_btn->SetMinSize(wxSize(-1, FromDIP(26)));
m_options_btn->Rescale(); m_options_btn->Rescale();
rescale_camera_icons();
Layout(); Layout();
Refresh(); Refresh();
} }

View file

@ -420,6 +420,7 @@ public:
void set_hold_count(int& count); void set_hold_count(int& count);
void rescale_camera_icons();
void on_sys_color_changed(); void on_sys_color_changed();
void msw_rescale(); void msw_rescale();
}; };