Update extruder show/hide and default extruder color in respect to the volume type

This commit is contained in:
YuSanka 2021-05-28 13:02:18 +02:00
parent 0a6490bab9
commit 8e1cde43a6
9 changed files with 133 additions and 77 deletions

View file

@ -290,16 +290,11 @@ wxWindow* BitmapChoiceRenderer::CreateEditorCtrl(wxWindow* parent, wxRect labelR
labelRect.GetTopLeft(), wxSize(labelRect.GetWidth(), -1),
0, nullptr , wxCB_READONLY);
int i=0;
for (wxBitmap* bmp : icons) {
if (i==0) {
c_editor->Append(_L("default"), *bmp);
++i;
}
int def_id = get_default_extruder_idx ? get_default_extruder_idx() : 0;
c_editor->Append(_L("default"), def_id < 0 ? wxNullBitmap : *icons[def_id]);
for (size_t i = 0; i < icons.size(); i++)
c_editor->Append(wxString::Format("%d", i+1), *icons[i]);
c_editor->Append(wxString::Format("%d", i), *bmp);
++i;
}
c_editor->SetSelection(atoi(data.GetText().c_str()));
// to avoid event propagation to other sidebar items