diff --git a/src/slic3r/GUI/2DBed.cpp b/src/slic3r/GUI/2DBed.cpp index c4eec0b03..e184b43fc 100644 --- a/src/slic3r/GUI/2DBed.cpp +++ b/src/slic3r/GUI/2DBed.cpp @@ -14,9 +14,10 @@ namespace GUI { Bed_2D::Bed_2D(wxWindow* parent) : wxPanel(parent, wxID_ANY, wxDefaultPosition, wxSize(25 * wxGetApp().em_unit(), -1), wxTAB_TRAVERSAL) { - SetBackgroundStyle(wxBG_STYLE_PAINT); // to avoid assert message after wxAutoBufferedPaintDC #ifdef __APPLE__ m_user_drawn_background = false; +#else + SetBackgroundStyle(wxBG_STYLE_PAINT); // to avoid assert message after wxAutoBufferedPaintDC #endif /*__APPLE__*/ } diff --git a/src/slic3r/GUI/BitmapComboBox.cpp b/src/slic3r/GUI/BitmapComboBox.cpp index 1864a3545..fcbc4b666 100644 --- a/src/slic3r/GUI/BitmapComboBox.cpp +++ b/src/slic3r/GUI/BitmapComboBox.cpp @@ -267,7 +267,7 @@ void BitmapComboBox::Rescale() // we need to refill control with new bitmaps const wxString selection = this->GetValue(); std::vector items; - for (int i = 0; i < GetCount(); i++) + for (size_t i = 0; i < GetCount(); i++) items.push_back(GetString(i)); this->Clear(); diff --git a/src/slic3r/GUI/GalleryDialog.cpp b/src/slic3r/GUI/GalleryDialog.cpp index d124eda69..163e33527 100644 --- a/src/slic3r/GUI/GalleryDialog.cpp +++ b/src/slic3r/GUI/GalleryDialog.cpp @@ -179,8 +179,8 @@ static void add_lock(wxImage& image) size_t beg_x = width - lock_width; size_t beg_y = height - lock_height; - for (size_t x = 0; x < lock_width; ++x) { - for (size_t y = 0; y < lock_height; ++y) { + for (size_t x = 0; x < (size_t)lock_width; ++x) { + for (size_t y = 0; y < (size_t)lock_height; ++y) { const size_t lock_idx = (x + y * lock_width); if (lock_a_data && lock_a_data[lock_idx] == 0) continue; diff --git a/src/slic3r/GUI/OptionsGroup.cpp b/src/slic3r/GUI/OptionsGroup.cpp index 7ebe71ef8..6624982dd 100644 --- a/src/slic3r/GUI/OptionsGroup.cpp +++ b/src/slic3r/GUI/OptionsGroup.cpp @@ -747,6 +747,10 @@ void ConfigOptionsGroup::sys_color_changed() wxGetApp().UpdateDarkUI(extra_col); } + if (custom_ctrl) + wxGetApp().UpdateDarkUI(custom_ctrl); +#endif + auto update = [](wxSizer* sizer) { for (wxSizerItem* item : sizer->GetChildren()) if (item->IsWindow()) { @@ -768,10 +772,6 @@ void ConfigOptionsGroup::sys_color_changed() update(line.extra_widget_sizer); } - if (custom_ctrl) - wxGetApp().UpdateDarkUI(custom_ctrl); -#endif - // update undo buttons : rescale bitmaps for (const auto& field : m_fields) field.second->sys_color_changed(); diff --git a/src/slic3r/GUI/Tab.cpp b/src/slic3r/GUI/Tab.cpp index 3cda9e3e4..b642610d8 100644 --- a/src/slic3r/GUI/Tab.cpp +++ b/src/slic3r/GUI/Tab.cpp @@ -709,29 +709,12 @@ void TabPrinter::msw_rescale() { Tab::msw_rescale(); - // rescale missed options_groups - const std::vector& pages = m_printer_technology == ptFFF ? m_pages_sla : m_pages_fff; - for (auto page : pages) - page->msw_rescale(); - if (m_reset_to_filament_color) m_reset_to_filament_color->msw_rescale(); Layout(); } -void TabPrinter::sys_color_changed() -{ - Tab::sys_color_changed(); - - // update missed options_groups - const std::vector& pages = m_printer_technology == ptFFF ? m_pages_sla : m_pages_fff; - for (auto page : pages) - page->sys_color_changed(); - - Layout(); -} - void TabSLAMaterial::init_options_list() { if (!m_options_list.empty()) diff --git a/src/slic3r/GUI/Tab.hpp b/src/slic3r/GUI/Tab.hpp index 65c817cb6..80b9cd873 100644 --- a/src/slic3r/GUI/Tab.hpp +++ b/src/slic3r/GUI/Tab.hpp @@ -485,7 +485,6 @@ public: void on_preset_loaded() override; void init_options_list() override; void msw_rescale() override; - void sys_color_changed() override; #if ENABLE_PROJECT_DIRTY_STATE bool supports_printer_technology(const PrinterTechnology /* tech */) const override { return true; } #else diff --git a/src/slic3r/GUI/wxExtensions.cpp b/src/slic3r/GUI/wxExtensions.cpp index 819c91c62..8903f3b30 100644 --- a/src/slic3r/GUI/wxExtensions.cpp +++ b/src/slic3r/GUI/wxExtensions.cpp @@ -889,6 +889,8 @@ bool ScalableButton::SetBitmap_(const std::string& bmp_name) wxBitmap bmp = create_scaled_bitmap(m_current_icon_name, m_parent, m_px_cnt); SetBitmap(bmp); SetBitmapCurrent(bmp); + SetBitmapPressed(bmp); + SetBitmapFocus(bmp); if (m_use_default_disabled_bitmap) SetBitmapDisabled(create_scaled_bitmap(m_current_icon_name, m_parent, m_px_cnt, true)); return true; @@ -920,7 +922,11 @@ void ScalableButton::msw_rescale() Slic3r::GUI::wxGetApp().UpdateDarkUI(this, m_has_border); if (!m_current_icon_name.empty()) { - SetBitmap(create_scaled_bitmap(m_current_icon_name, m_parent, m_px_cnt)); + wxBitmap bmp = create_scaled_bitmap(m_current_icon_name, m_parent, m_px_cnt); + SetBitmap(bmp); + SetBitmapCurrent(bmp); + SetBitmapPressed(bmp); + SetBitmapFocus(bmp); if (!m_disabled_icon_name.empty()) SetBitmapDisabled(create_scaled_bitmap(m_disabled_icon_name, m_parent, m_px_cnt)); else if (m_use_default_disabled_bitmap)