Skip to content

Commit

Permalink
Linux specific: Fixed ObjectDataViewModel::GetColumnType()
Browse files Browse the repository at this point in the history
When "string" type was returned, strange editing TextControl was appeared.
+ Added check of the selection for ObjectList::toggle_printable_state() function
  • Loading branch information
YuSanka committed May 10, 2021
1 parent 426d2cd commit b87c03f
Show file tree
Hide file tree
Showing 3 changed files with 12 additions and 1 deletion.
2 changes: 2 additions & 0 deletions src/slic3r/GUI/GUI_ObjectList.cpp
Expand Up @@ -3909,6 +3909,8 @@ void ObjectList::toggle_printable_state()
{
wxDataViewItemArray sels;
GetSelections(sels);
if (sels.IsEmpty())
return;

wxDataViewItem frst_item = sels[0];

Expand Down
9 changes: 9 additions & 0 deletions src/slic3r/GUI/ObjectDataViewModel.cpp
Expand Up @@ -1180,6 +1180,15 @@ int ObjectDataViewModel::GetExtruderNumber(const wxDataViewItem& item) const
return atoi(node->m_extruder.c_str());
}

wxString ObjectDataViewModel::GetColumnType(unsigned int col) const
{
if (col == colName || col == colExtruder)
return wxT("DataViewBitmapText");
if (col == colPrint || col == colEditing)
return wxT("DataViewBitmap");
return wxT("string");
}

void ObjectDataViewModel::GetValue(wxVariant &variant, const wxDataViewItem &item, unsigned int col) const
{
wxASSERT(item.IsOk());
Expand Down
2 changes: 1 addition & 1 deletion src/slic3r/GUI/ObjectDataViewModel.hpp
Expand Up @@ -316,7 +316,7 @@ class ObjectDataViewModel :public wxDataViewModel
// helper methods to change the model

unsigned int GetColumnCount() const override { return 3;}
wxString GetColumnType(unsigned int col) const override{ return wxT("string"); }
wxString GetColumnType(unsigned int col) const override;

void GetValue( wxVariant &variant,
const wxDataViewItem &item,
Expand Down

0 comments on commit b87c03f

Please sign in to comment.