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.
This commit is contained in:
bubnikv 2019-03-23 08:23:22 +01:00
parent c623cbc4d7
commit 4f585f1157
2 changed files with 7 additions and 1 deletions

View File

@ -540,7 +540,10 @@ void Choice::BUILD() {
else{ else{
for (auto el : m_opt.enum_labels.empty() ? m_opt.enum_values : m_opt.enum_labels) { 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; 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(); set_selection();
} }

View File

@ -10,6 +10,8 @@
#include "I18N.hpp" #include "I18N.hpp"
#include <wx/wupdlock.h>
namespace Slic3r namespace Slic3r
{ {
namespace GUI namespace GUI
@ -84,6 +86,7 @@ void ObjectSettings::update_settings_list()
btn->Bind(wxEVT_BUTTON, [opt_key, config, this](wxEvent &event) { btn->Bind(wxEVT_BUTTON, [opt_key, config, this](wxEvent &event) {
config->erase(opt_key); config->erase(opt_key);
wxTheApp->CallAfter([this]() { wxTheApp->CallAfter([this]() {
wxWindowUpdateLocker noUpdates(m_parent);
update_settings_list(); update_settings_list();
m_parent->Layout(); m_parent->Layout();
}); });