Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/prusa3d/PrusaSlicer.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorYuSanka <yusanka@gmail.com>2020-08-05 21:26:40 +0300
committerYuSanka <yusanka@gmail.com>2020-08-05 21:26:40 +0300
commit93c1671e09b65905ac7da7bba60dcea15d9f5e4e (patch)
treef5730452c32141f50fa59e9473a6c1051d14f8b0 /src/slic3r/GUI/GUI_ObjectList.cpp
parent1674d2af291b1933fd28258e5415501079f23ce9 (diff)
Custom renderers extracted from the ObjectDataViewModel
Diffstat (limited to 'src/slic3r/GUI/GUI_ObjectList.cpp')
-rw-r--r--src/slic3r/GUI/GUI_ObjectList.cpp14
1 files changed, 11 insertions, 3 deletions
diff --git a/src/slic3r/GUI/GUI_ObjectList.cpp b/src/slic3r/GUI/GUI_ObjectList.cpp
index 9d6b2b9cb..a434e39fd 100644
--- a/src/slic3r/GUI/GUI_ObjectList.cpp
+++ b/src/slic3r/GUI/GUI_ObjectList.cpp
@@ -277,7 +277,11 @@ void ObjectList::create_objects_ctrl()
// column ItemName(Icon+Text) of the view control:
// And Icon can be consisting of several bitmaps
- AppendColumn(new wxDataViewColumn(_(L("Name")), new BitmapTextRenderer(this),
+ BitmapTextRenderer* bmp_text_renderer = new BitmapTextRenderer(this);
+ bmp_text_renderer->set_can_create_editor_ctrl_function([this]() {
+ return m_objects_model->GetItemType(GetSelection()) & (itVolume | itObject);
+ });
+ AppendColumn(new wxDataViewColumn(_L("Name"), bmp_text_renderer,
colName, 20*em, wxALIGN_LEFT, wxDATAVIEW_COL_RESIZABLE));
// column PrintableProperty (Icon) of the view control:
@@ -285,11 +289,15 @@ void ObjectList::create_objects_ctrl()
wxALIGN_CENTER_HORIZONTAL, wxDATAVIEW_COL_RESIZABLE);
// column Extruder of the view control:
- AppendColumn(new wxDataViewColumn(_(L("Extruder")), new BitmapChoiceRenderer(),
+ BitmapChoiceRenderer* bmp_choice_renderer = new BitmapChoiceRenderer();
+ bmp_choice_renderer->set_can_create_editor_ctrl_function([this]() {
+ return m_objects_model->GetItemType(GetSelection()) & (itVolume | itLayer | itObject);
+ });
+ AppendColumn(new wxDataViewColumn(_L("Extruder"), bmp_choice_renderer,
colExtruder, 8*em, wxALIGN_CENTER_HORIZONTAL, wxDATAVIEW_COL_RESIZABLE));
// column ItemEditing of the view control:
- AppendBitmapColumn(_(L("Editing")), colEditing, wxDATAVIEW_CELL_INERT, 3*em,
+ AppendBitmapColumn(_L("Editing"), colEditing, wxDATAVIEW_CELL_INERT, 3*em,
wxALIGN_CENTER_HORIZONTAL, wxDATAVIEW_COL_RESIZABLE);
// For some reason under OSX on 4K(5K) monitors in wxDataViewColumn constructor doesn't set width of column.