mirror of
https://git.mirrors.martin98.com/https://github.com/prusa3d/PrusaSlicer.git
synced 2025-05-10 00:59:10 +08:00
Fixed "extruder" column editing for non-object/part items. It's suppressed now.
+ Try to fix the wrong last column width updating under OSX
This commit is contained in:
parent
428800ad1e
commit
e0aa25b677
@ -77,7 +77,13 @@ ObjectList::ObjectList(wxWindow* parent) :
|
||||
Bind(wxEVT_DATAVIEW_ITEM_DROP_POSSIBLE, [this](wxDataViewEvent& e) {on_drop_possible(e); });
|
||||
Bind(wxEVT_DATAVIEW_ITEM_DROP, [this](wxDataViewEvent& e) {on_drop(e); });
|
||||
|
||||
Bind(wxCUSTOMEVT_LAST_VOLUME_IS_DELETED,[this](wxCommandEvent& e) {last_volume_is_deleted(e.GetInt()); });
|
||||
Bind(wxCUSTOMEVT_LAST_VOLUME_IS_DELETED, [this](wxCommandEvent& e) {last_volume_is_deleted(e.GetInt()); });
|
||||
|
||||
// Bind(wxEVT_DATAVIEW_ITEM_VALUE_CHANGED, &ObjectList::OnValueChanged, this);
|
||||
// Bind(wxEVT_DATAVIEW_ITEM_ACTIVATED, &ObjectList::OnActivated, this);
|
||||
Bind(wxEVT_DATAVIEW_ITEM_START_EDITING, &ObjectList::OnStartEditing, this);
|
||||
// Bind(wxEVT_DATAVIEW_ITEM_EDITING_STARTED, &ObjectList::OnEditingStarted, this);
|
||||
// Bind(wxEVT_DATAVIEW_ITEM_EDITING_DONE, &ObjectList::OnEditingDone, this
|
||||
}
|
||||
|
||||
ObjectList::~ObjectList()
|
||||
@ -203,6 +209,8 @@ void ObjectList::update_objects_list_extruder_column(int extruders_count)
|
||||
InsertColumn(1, create_objects_list_extruder_column(extruders_count));
|
||||
// set show/hide for this column
|
||||
set_extruder_column_hidden(extruders_count <= 1);
|
||||
//a workaround for a wrong last column width updating under OSX
|
||||
GetColumn(2)->SetWidth(25);
|
||||
}
|
||||
|
||||
void ObjectList::set_extruder_column_hidden(bool hide)
|
||||
@ -1600,5 +1608,12 @@ void ObjectList::update_settings_items()
|
||||
UnselectAll();
|
||||
}
|
||||
|
||||
void ObjectList::OnStartEditing(wxDataViewEvent &event)
|
||||
{
|
||||
const auto item_type = m_objects_model->GetItemType(event.GetItem());
|
||||
if ( !(item_type&(itObject|itVolume)) )
|
||||
event.Veto();
|
||||
}
|
||||
|
||||
} //namespace GUI
|
||||
} //namespace Slic3r
|
@ -185,6 +185,10 @@ public:
|
||||
void last_volume_is_deleted(const int obj_idx);
|
||||
bool has_multi_part_objects();
|
||||
void update_settings_items();
|
||||
|
||||
private:
|
||||
void OnStartEditing(wxDataViewEvent &event);
|
||||
|
||||
};
|
||||
|
||||
|
||||
|
Loading…
x
Reference in New Issue
Block a user