diff --git a/src/slic3r/GUI/WipeTowerDialog.cpp b/src/slic3r/GUI/WipeTowerDialog.cpp index 768215bd8..04be4963d 100644 --- a/src/slic3r/GUI/WipeTowerDialog.cpp +++ b/src/slic3r/GUI/WipeTowerDialog.cpp @@ -154,6 +154,8 @@ void WipingDialog::on_dpi_changed(const wxRect &suggested_rect) button_item.second->SetCornerRadius(FromDIP(12)); } } + m_panel_wiping->msw_rescale(); + this->Refresh(); }; // Parent dialog for purging volume adjustments - it fathers WipingPanel widget (that contains all controls) and a button to toggle simple/advanced mode: @@ -224,8 +226,9 @@ void WipingPanel::create_panels(wxWindow* parent, const int num) { panel->SetSizer(sizer); wxButton* icon = new wxButton(panel, wxID_ANY, {}, wxDefaultPosition, ICON_SIZE, wxBORDER_NONE | wxBU_AUTODRAW); - icon->SetBitmap(*get_extruder_color_icon(m_colours[i].GetAsString(wxC2S_HTML_SYNTAX).ToStdString(), std::to_string(i + 1), 16, 16)); + icon->SetBitmap(*get_extruder_color_icon(m_colours[i].GetAsString(wxC2S_HTML_SYNTAX).ToStdString(), std::to_string(i + 1), FromDIP(16), FromDIP(16))); icon->SetCanFocus(false); + icon_list2.push_back(icon); sizer->AddSpacer(ROW_BEG_PADDING); sizer->Add(icon, 0, wxALIGN_CENTER_VERTICAL | wxTOP | wxBOTTOM, ROW_VERT_PADDING); @@ -324,9 +327,10 @@ WipingPanel::WipingPanel(wxWindow* parent, const std::vector& matrix, con header_line_sizer->AddSpacer(HEADER_BEG_PADDING); for (unsigned int i = 0; i < m_number_of_extruders; ++i) { wxButton* icon = new wxButton(header_line_panel, wxID_ANY, {}, wxDefaultPosition, ICON_SIZE, wxBORDER_NONE | wxBU_AUTODRAW); - icon->SetBitmap(*get_extruder_color_icon(m_colours[i].GetAsString(wxC2S_HTML_SYNTAX).ToStdString(), std::to_string(i + 1), 16, 16)); + icon->SetBitmap(*get_extruder_color_icon(m_colours[i].GetAsString(wxC2S_HTML_SYNTAX).ToStdString(), std::to_string(i + 1), FromDIP(16), FromDIP(16))); icon->SetCanFocus(false); - + icon_list1.push_back(icon); + header_line_sizer->AddSpacer(ICON_GAP); header_line_sizer->Add(icon, 0, wxALIGN_CENTER_VERTICAL | wxTOP | wxBOTTOM, HEADER_VERT_PADDING); } @@ -569,6 +573,14 @@ void WipingPanel::calc_flushing_volumes() this->update_warning_texts(); } +void WipingPanel::msw_rescale() +{ + for (unsigned int i = 0; i < icon_list1.size(); ++i) { + auto bitmap = *get_extruder_color_icon(m_colours[i].GetAsString(wxC2S_HTML_SYNTAX).ToStdString(), std::to_string(i + 1), FromDIP(16), FromDIP(16)); + icon_list1[i]->SetBitmap(bitmap); + icon_list2[i]->SetBitmap(bitmap); + } +} // Reads values from the (advanced) wiping matrix: std::vector WipingPanel::read_matrix_values() { diff --git a/src/slic3r/GUI/WipeTowerDialog.hpp b/src/slic3r/GUI/WipeTowerDialog.hpp index 8566f4d1e..91f7612ec 100644 --- a/src/slic3r/GUI/WipeTowerDialog.hpp +++ b/src/slic3r/GUI/WipeTowerDialog.hpp @@ -21,6 +21,7 @@ public: void toggle_advanced(bool user_action = false); void create_panels(wxWindow* parent, const int num); void calc_flushing_volumes(); + void msw_rescale(); float get_flush_multiplier() { @@ -50,6 +51,8 @@ private: wxBoxSizer* m_sizer_advanced = nullptr; wxGridSizer* m_gridsizer_advanced = nullptr; wxButton* m_widget_button = nullptr; + std::vector icon_list1; + std::vector icon_list2; const int m_min_flush_volume; const int m_max_flush_volume;