From 4f585f11575d49dd086bc65badd4b3ebe2f10955 Mon Sep 17 00:00:00 2001 From: bubnikv Date: Sat, 23 Mar 2019 08:23:22 +0100 Subject: [PATCH] Improved rendering when deleting an option from object's overrides. Replaced the single column icon with an empty icon. Will it break something? The single column added an ugly spacer in front of non-editable combo boxes. --- src/slic3r/GUI/Field.cpp | 5 ++++- src/slic3r/GUI/GUI_ObjectSettings.cpp | 3 +++ 2 files changed, 7 insertions(+), 1 deletion(-) diff --git a/src/slic3r/GUI/Field.cpp b/src/slic3r/GUI/Field.cpp index 026b62ab5..9cd933160 100644 --- a/src/slic3r/GUI/Field.cpp +++ b/src/slic3r/GUI/Field.cpp @@ -540,7 +540,10 @@ void Choice::BUILD() { else{ for (auto el : m_opt.enum_labels.empty() ? m_opt.enum_values : m_opt.enum_labels) { const wxString& str = _(el);//m_opt_id == "support" ? _(el) : el; - temp->Append(str, create_scaled_bitmap("empty_icon.png")); + //FIXME Vojtech: Why is the single column empty icon necessary? It is a workaround of some kind, but what for? + // Please document such workarounds by comments! + // temp->Append(str, create_scaled_bitmap("empty_icon.png")); + temp->Append(str, wxNullBitmap); } set_selection(); } diff --git a/src/slic3r/GUI/GUI_ObjectSettings.cpp b/src/slic3r/GUI/GUI_ObjectSettings.cpp index db9af7cce..dbfdb8e6c 100644 --- a/src/slic3r/GUI/GUI_ObjectSettings.cpp +++ b/src/slic3r/GUI/GUI_ObjectSettings.cpp @@ -10,6 +10,8 @@ #include "I18N.hpp" +#include + namespace Slic3r { namespace GUI @@ -84,6 +86,7 @@ void ObjectSettings::update_settings_list() btn->Bind(wxEVT_BUTTON, [opt_key, config, this](wxEvent &event) { config->erase(opt_key); wxTheApp->CallAfter([this]() { + wxWindowUpdateLocker noUpdates(m_parent); update_settings_list(); m_parent->Layout(); });