ObjectDataViewModel: Added function to add warning icon
This commit is contained in:
parent
c0b73a92a3
commit
4a5496e3de
4 changed files with 21 additions and 1 deletions
|
@ -3951,6 +3951,8 @@ void ObjectList::update_item_error_icon(const int obj_idx, const int vol_idx) co
|
||||||
// unmark fixed item only
|
// unmark fixed item only
|
||||||
m_objects_model->DeleteWarningIcon(item);
|
m_objects_model->DeleteWarningIcon(item);
|
||||||
}
|
}
|
||||||
|
else
|
||||||
|
m_objects_model->AddWarningIcon(item);
|
||||||
}
|
}
|
||||||
|
|
||||||
void ObjectList::msw_rescale()
|
void ObjectList::msw_rescale()
|
||||||
|
|
|
@ -208,7 +208,6 @@ void GLGizmoSimplify::on_render_input_window(float x, float y, float bottom_limi
|
||||||
|
|
||||||
// Fix warning icon in object list
|
// Fix warning icon in object list
|
||||||
wxGetApp().obj_list()->update_item_error_icon(obj_index, -1);
|
wxGetApp().obj_list()->update_item_error_icon(obj_index, -1);
|
||||||
wxGetApp().obj_list()->part_selection_changed();
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
|
@ -1696,6 +1696,24 @@ wxBitmap ObjectDataViewModel::GetVolumeIcon(const Slic3r::ModelVolumeType vol_ty
|
||||||
return *bmp;
|
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*/)
|
void ObjectDataViewModel::DeleteWarningIcon(const wxDataViewItem& item, const bool unmark_object/* = false*/)
|
||||||
{
|
{
|
||||||
if (!item.IsOk())
|
if (!item.IsOk())
|
||||||
|
|
|
@ -375,6 +375,7 @@ public:
|
||||||
|
|
||||||
wxBitmap GetVolumeIcon(const Slic3r::ModelVolumeType vol_type,
|
wxBitmap GetVolumeIcon(const Slic3r::ModelVolumeType vol_type,
|
||||||
const bool is_marked = false);
|
const bool is_marked = false);
|
||||||
|
void AddWarningIcon(const wxDataViewItem& item);
|
||||||
void DeleteWarningIcon(const wxDataViewItem& item, const bool unmark_object = false);
|
void DeleteWarningIcon(const wxDataViewItem& item, const bool unmark_object = false);
|
||||||
t_layer_height_range GetLayerRangeByItem(const wxDataViewItem& item) const;
|
t_layer_height_range GetLayerRangeByItem(const wxDataViewItem& item) const;
|
||||||
|
|
||||||
|
|
Loading…
Reference in a new issue