ObjectList: Fixed mouse click on the WarningIcon, when mesh wasn't repaired and isn't manifold.
This commit is contained in:
parent
9e2fa3cd4d
commit
47b54d5ce0
3 changed files with 12 additions and 1 deletions
|
@ -904,7 +904,7 @@ void ObjectList::list_manipulation(const wxPoint& mouse_pos, bool evt_context_me
|
||||||
int obj_idx, vol_idx;
|
int obj_idx, vol_idx;
|
||||||
get_selected_item_indexes(obj_idx, vol_idx, item);
|
get_selected_item_indexes(obj_idx, vol_idx, item);
|
||||||
|
|
||||||
if (get_mesh_errors_count(obj_idx, vol_idx) > 0 &&
|
if (m_objects_model->HasWarningIcon(item) &&
|
||||||
mouse_pos.x > 2 * wxGetApp().em_unit() && mouse_pos.x < 4 * wxGetApp().em_unit())
|
mouse_pos.x > 2 * wxGetApp().em_unit() && mouse_pos.x < 4 * wxGetApp().em_unit())
|
||||||
fix_through_netfabb();
|
fix_through_netfabb();
|
||||||
}
|
}
|
||||||
|
|
|
@ -1777,6 +1777,15 @@ void ObjectDataViewModel::DeleteWarningIcon(const wxDataViewItem& item, const bo
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
bool ObjectDataViewModel::HasWarningIcon(const wxDataViewItem& item) const
|
||||||
|
{
|
||||||
|
if (!item.IsOk())
|
||||||
|
return false;
|
||||||
|
|
||||||
|
ObjectDataViewModelNode *node = static_cast<ObjectDataViewModelNode*>(item.GetID());
|
||||||
|
return node->has_warning_icon();
|
||||||
|
}
|
||||||
|
|
||||||
} // namespace GUI
|
} // namespace GUI
|
||||||
} // namespace Slic3r
|
} // namespace Slic3r
|
||||||
|
|
||||||
|
|
|
@ -240,6 +240,7 @@ public:
|
||||||
bool valid();
|
bool valid();
|
||||||
#endif /* NDEBUG */
|
#endif /* NDEBUG */
|
||||||
bool invalid() const { return m_idx < -1; }
|
bool invalid() const { return m_idx < -1; }
|
||||||
|
bool has_warning_icon() const { return !m_warning_icon_name.empty(); }
|
||||||
|
|
||||||
private:
|
private:
|
||||||
friend class ObjectDataViewModel;
|
friend class ObjectDataViewModel;
|
||||||
|
@ -388,6 +389,7 @@ public:
|
||||||
const std::string& warning_icon_name = std::string());
|
const std::string& warning_icon_name = std::string());
|
||||||
void AddWarningIcon(const wxDataViewItem& item, const std::string& warning_name);
|
void AddWarningIcon(const wxDataViewItem& item, const std::string& warning_name);
|
||||||
void DeleteWarningIcon(const wxDataViewItem& item, const bool unmark_object = false);
|
void DeleteWarningIcon(const wxDataViewItem& item, const bool unmark_object = false);
|
||||||
|
bool HasWarningIcon(const wxDataViewItem& item) const;
|
||||||
t_layer_height_range GetLayerRangeByItem(const wxDataViewItem& item) const;
|
t_layer_height_range GetLayerRangeByItem(const wxDataViewItem& item) const;
|
||||||
|
|
||||||
bool UpdateColumValues(unsigned col);
|
bool UpdateColumValues(unsigned col);
|
||||||
|
|
Loading…
Reference in a new issue