Added tooltips for objects list
Updated icons with transparency
Before Width: | Height: | Size: 591 B After Width: | Height: | Size: 829 B |
Before Width: | Height: | Size: 327 B After Width: | Height: | Size: 1.0 KiB |
BIN
resources/icons/lambda.png
Normal file
After Width: | Height: | Size: 913 B |
Before Width: | Height: | Size: 618 B After Width: | Height: | Size: 1017 B |
BIN
resources/icons/split.png
Normal file
After Width: | Height: | Size: 1021 B |
@ -101,12 +101,15 @@ void get_options_menu(settings_menu_hierarchy& settings_menu, bool is_part)
|
|||||||
{
|
{
|
||||||
auto options = get_options(is_part);
|
auto options = get_options(is_part);
|
||||||
|
|
||||||
|
auto extruders_cnt = get_preset_bundle()->printers.get_edited_preset().config.option<ConfigOptionFloats>("nozzle_diameter")->values.size();
|
||||||
|
|
||||||
DynamicPrintConfig config;
|
DynamicPrintConfig config;
|
||||||
for (auto& option : options)
|
for (auto& option : options)
|
||||||
{
|
{
|
||||||
auto const opt = config.def()->get(option);
|
auto const opt = config.def()->get(option);
|
||||||
auto category = opt->category;
|
auto category = opt->category;
|
||||||
if (category.empty()) continue;
|
if (category.empty() ||
|
||||||
|
(category == "Extruders" && extruders_cnt == 1)) continue;
|
||||||
|
|
||||||
std::pair<std::string, std::string> option_label(option, opt->label);
|
std::pair<std::string, std::string> option_label(option, opt->label);
|
||||||
std::vector< std::pair<std::string, std::string> > new_category;
|
std::vector< std::pair<std::string, std::string> > new_category;
|
||||||
@ -135,7 +138,7 @@ void set_objects_from_model(Model &model) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
void init_mesh_icons(){
|
void init_mesh_icons(){
|
||||||
m_icon_modifiermesh = wxIcon(Slic3r::GUI::from_u8(Slic3r::var("lambda_.png")), wxBITMAP_TYPE_PNG);//(Slic3r::var("plugin.png")), wxBITMAP_TYPE_PNG);
|
m_icon_modifiermesh = wxIcon(Slic3r::GUI::from_u8(Slic3r::var("lambda.png")), wxBITMAP_TYPE_PNG);//(Slic3r::var("plugin.png")), wxBITMAP_TYPE_PNG);
|
||||||
m_icon_solidmesh = wxIcon(Slic3r::GUI::from_u8(Slic3r::var("object.png")), wxBITMAP_TYPE_PNG);//(Slic3r::var("package.png")), wxBITMAP_TYPE_PNG);
|
m_icon_solidmesh = wxIcon(Slic3r::GUI::from_u8(Slic3r::var("object.png")), wxBITMAP_TYPE_PNG);//(Slic3r::var("package.png")), wxBITMAP_TYPE_PNG);
|
||||||
|
|
||||||
// init icon for manifold warning
|
// init icon for manifold warning
|
||||||
@ -195,7 +198,7 @@ wxBoxSizer* content_objects_list(wxWindow *win)
|
|||||||
m_objects_ctrl->AppendColumn(column3);
|
m_objects_ctrl->AppendColumn(column3);
|
||||||
|
|
||||||
// column 4 of the view control:
|
// column 4 of the view control:
|
||||||
m_objects_ctrl->AppendBitmapColumn("", 4, wxDATAVIEW_CELL_INERT, 25,
|
m_objects_ctrl->AppendBitmapColumn(" ", 4, wxDATAVIEW_CELL_INERT, 25,
|
||||||
wxALIGN_CENTER_HORIZONTAL, wxDATAVIEW_COL_RESIZABLE);
|
wxALIGN_CENTER_HORIZONTAL, wxDATAVIEW_COL_RESIZABLE);
|
||||||
|
|
||||||
m_objects_ctrl->Bind(wxEVT_DATAVIEW_SELECTION_CHANGED, [](wxEvent& event)
|
m_objects_ctrl->Bind(wxEVT_DATAVIEW_SELECTION_CHANGED, [](wxEvent& event)
|
||||||
@ -248,6 +251,19 @@ wxBoxSizer* content_objects_list(wxWindow *win)
|
|||||||
});
|
});
|
||||||
#endif //__WXMSW__
|
#endif //__WXMSW__
|
||||||
|
|
||||||
|
m_objects_ctrl->GetMainWindow()->Bind(wxEVT_MOTION, [](wxMouseEvent& event) {
|
||||||
|
wxPoint pt = event.GetPosition();
|
||||||
|
wxDataViewItem item;
|
||||||
|
wxDataViewColumn* col;
|
||||||
|
m_objects_ctrl->HitTest(pt, item, col);
|
||||||
|
if (col->GetTitle() == " " && item)
|
||||||
|
m_objects_ctrl->GetMainWindow()->SetToolTip(_(L("For object settings changing click a right button on icon")));
|
||||||
|
else
|
||||||
|
m_objects_ctrl->GetMainWindow()->SetToolTip("");
|
||||||
|
// if (m_objects_model->GetIcon(item) == m_icon_manifold_warning)
|
||||||
|
// m_objects_ctrl->GetMainWindow()->SetToolTip("Tru-lala");
|
||||||
|
});
|
||||||
|
|
||||||
return objects_sz;
|
return objects_sz;
|
||||||
}
|
}
|
||||||
|
|
||||||
@ -604,9 +620,11 @@ void add_object_to_list(const std::string &name, ModelObject* model_object)
|
|||||||
m_objects_model->SetValue(variant, item, 0);
|
m_objects_model->SetValue(variant, item, 0);
|
||||||
}
|
}
|
||||||
|
|
||||||
if (model_object->volumes.size() > 1)
|
if (model_object->volumes.size() > 1) {
|
||||||
for (auto id = 0; id < model_object->volumes.size(); id++)
|
for (auto id = 0; id < model_object->volumes.size(); id++)
|
||||||
m_objects_model->AddChild(item, model_object->volumes[id]->name, m_icon_solidmesh, false);
|
m_objects_model->AddChild(item, model_object->volumes[id]->name, m_icon_solidmesh, false);
|
||||||
|
m_objects_ctrl->Expand(item);
|
||||||
|
}
|
||||||
|
|
||||||
// part_selection_changed();
|
// part_selection_changed();
|
||||||
#ifdef __WXMSW__
|
#ifdef __WXMSW__
|
||||||
@ -741,9 +759,12 @@ void update_settings_list()
|
|||||||
if (opt_keys.size() == 1 && opt_keys[0] == "extruder")
|
if (opt_keys.size() == 1 && opt_keys[0] == "extruder")
|
||||||
return;
|
return;
|
||||||
|
|
||||||
|
auto extruders_cnt = get_preset_bundle()->printers.get_edited_preset().config.option<ConfigOptionFloats>("nozzle_diameter")->values.size();
|
||||||
|
|
||||||
for (auto& opt_key : opt_keys) {
|
for (auto& opt_key : opt_keys) {
|
||||||
auto category = (*m_config)->def()->get(opt_key)->category;
|
auto category = (*m_config)->def()->get(opt_key)->category;
|
||||||
if (category.empty()) continue;
|
if (category.empty() ||
|
||||||
|
(category == "Extruders" && extruders_cnt==1)) continue;
|
||||||
|
|
||||||
std::vector< std::string > new_category;
|
std::vector< std::string > new_category;
|
||||||
|
|
||||||
|
@ -566,6 +566,12 @@ wxString PrusaObjectDataViewModel::GetScale(const wxDataViewItem &item) const
|
|||||||
return node->m_scale;
|
return node->m_scale;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
wxIcon PrusaObjectDataViewModel::GetIcon(const wxDataViewItem &item) const
|
||||||
|
{
|
||||||
|
PrusaObjectDataViewModelNode *node = (PrusaObjectDataViewModelNode*)item.GetID();
|
||||||
|
return node->m_icon;
|
||||||
|
}
|
||||||
|
|
||||||
void PrusaObjectDataViewModel::GetValue(wxVariant &variant, const wxDataViewItem &item, unsigned int col) const
|
void PrusaObjectDataViewModel::GetValue(wxVariant &variant, const wxDataViewItem &item, unsigned int col) const
|
||||||
{
|
{
|
||||||
wxASSERT(item.IsOk());
|
wxASSERT(item.IsOk());
|
||||||
|
@ -365,6 +365,7 @@ public:
|
|||||||
wxString GetName(const wxDataViewItem &item) const;
|
wxString GetName(const wxDataViewItem &item) const;
|
||||||
wxString GetCopy(const wxDataViewItem &item) const;
|
wxString GetCopy(const wxDataViewItem &item) const;
|
||||||
wxString GetScale(const wxDataViewItem &item) const;
|
wxString GetScale(const wxDataViewItem &item) const;
|
||||||
|
wxIcon GetIcon(const wxDataViewItem &item) const;
|
||||||
|
|
||||||
// helper methods to change the model
|
// helper methods to change the model
|
||||||
|
|
||||||
|