ObjectDataViewModel: Added function to add warning icon

This commit is contained in:
YuSanka 2021-07-23 13:48:38 +02:00
parent c0b73a92a3
commit 4a5496e3de
4 changed files with 21 additions and 1 deletions

View file

@ -3951,6 +3951,8 @@ void ObjectList::update_item_error_icon(const int obj_idx, const int vol_idx) co
// unmark fixed item only
m_objects_model->DeleteWarningIcon(item);
}
else
m_objects_model->AddWarningIcon(item);
}
void ObjectList::msw_rescale()

View file

@ -208,7 +208,6 @@ void GLGizmoSimplify::on_render_input_window(float x, float y, float bottom_limi
// Fix warning icon in object list
wxGetApp().obj_list()->update_item_error_icon(obj_index, -1);
wxGetApp().obj_list()->part_selection_changed();
}
}

View file

@ -1696,6 +1696,24 @@ wxBitmap ObjectDataViewModel::GetVolumeIcon(const Slic3r::ModelVolumeType vol_ty
return *bmp;
}
void ObjectDataViewModel::AddWarningIcon(const wxDataViewItem& item)
{
if (!item.IsOk())
return;
ObjectDataViewModelNode *node = static_cast<ObjectDataViewModelNode*>(item.GetID());
if (node->GetType() & itObject) {
node->SetBitmap(m_warning_bmp);
return;
}
if (node->GetType() & itVolume) {
node->SetBitmap(GetVolumeIcon(node->GetVolumeType(), true));
node->GetParent()->SetBitmap(m_warning_bmp);
return;
}
}
void ObjectDataViewModel::DeleteWarningIcon(const wxDataViewItem& item, const bool unmark_object/* = false*/)
{
if (!item.IsOk())

View file

@ -375,6 +375,7 @@ public:
wxBitmap GetVolumeIcon(const Slic3r::ModelVolumeType vol_type,
const bool is_marked = false);
void AddWarningIcon(const wxDataViewItem& item);
void DeleteWarningIcon(const wxDataViewItem& item, const bool unmark_object = false);
t_layer_height_range GetLayerRangeByItem(const wxDataViewItem& item) const;