FIX: update the scale of ColorPicker

jira: [STUDIO-12704]
Change-Id: Iac12a24fcb880b0c5db6f62b1b0e38a9c5d60e9d
(cherry picked from commit c8bb7fb3acfc65312cacb4b38f0a7ba62810046a)
This commit is contained in:
xin.zhang 2025-06-20 16:24:55 +08:00 committed by Noisyfox
parent 3c4e28eb6c
commit 59ff362296
3 changed files with 11 additions and 10 deletions

View file

@ -1075,11 +1075,6 @@ void AMSMaterialsSetting::post_select_event(int index) {
wxPostEvent(m_comboBox_filament, event);
}
void AMSMaterialsSetting::msw_rescale()
{
m_clr_picker->msw_rescale();
}
void AMSMaterialsSetting::on_select_cali_result(wxCommandEvent &evt)
{
m_pa_cali_select_id = evt.GetSelection();
@ -1334,7 +1329,7 @@ void AMSMaterialsSetting::on_dpi_changed(const wxRect &suggested_rect)
m_input_nozzle_max->GetTextCtrl()->SetSize(wxSize(-1, FromDIP(20)));
m_input_nozzle_min->GetTextCtrl()->SetSize(wxSize(-1, FromDIP(20)));
m_input_k_val->GetTextCtrl()->SetSize(wxSize(-1, FromDIP(20)));
//m_clr_picker->msw_rescale();
m_clr_picker->msw_rescale();
degree->msw_rescale();
bitmap_max_degree->SetBitmap(degree->bmp());
bitmap_min_degree->SetBitmap(degree->bmp());
@ -1368,6 +1363,7 @@ void ColorPicker::msw_rescale()
{
m_bitmap_border = create_scaled_bitmap("color_picker_border", nullptr, 25);
m_bitmap_border_dark = create_scaled_bitmap("color_picker_border_dark", nullptr, 25);
m_bitmap_transparent = create_scaled_bitmap("transparent_color_picker", nullptr, 25);
Refresh();
}
@ -1422,7 +1418,10 @@ void ColorPicker::doRender(wxDC& dc)
if (m_selected) radius -= FromDIP(1);
if (alpha == 0) {
dc.DrawBitmap(m_bitmap_transparent, 0, 0);
wxSize bmp_size = m_bitmap_transparent.GetSize();
int center_x = (size.x - bmp_size.x) / 2;
int center_y = (size.y - bmp_size.y) / 2;
dc.DrawBitmap(m_bitmap_transparent, center_x, center_y);
}
else if (alpha != 254 && alpha != 255) {
if (transparent_changed) {
@ -1438,7 +1437,11 @@ void ColorPicker::doRender(wxDC& dc)
replace.push_back(fill_replace);
m_bitmap_transparent = ScalableBitmap(this, "transparent_color_picker", 25, false, false, true, replace).bmp();
transparent_changed = false;
dc.DrawBitmap(m_bitmap_transparent, 0, 0);
wxSize bmp_size = m_bitmap_transparent.GetSize();
int center_x = (size.x - bmp_size.x) / 2;
int center_y = (size.y - bmp_size.y) / 2;
dc.DrawBitmap(m_bitmap_transparent, center_x, center_y);
}
}
else {

View file

@ -109,7 +109,6 @@ public:
wxString k = wxEmptyString, wxString n = wxEmptyString);
void post_select_event(int index);
void msw_rescale();
void set_color(wxColour color);
void set_empty_color(wxColour color);
void set_colors(std::vector<wxColour> colors);

View file

@ -5287,7 +5287,6 @@ void StatusPanel::on_sys_color_changed()
m_switch_speed->SetImages(m_bitmap_speed, m_bitmap_speed);
m_ams_control->msw_rescale();
if (m_print_error_dlg) { m_print_error_dlg->msw_rescale(); }
if (m_filament_setting_dlg) {m_filament_setting_dlg->msw_rescale();}
rescale_camera_icons();
}