Scroll the Object List to selected item been visible in the list (after object/part selection from the 3DScene)

This commit is contained in:
YuSanka 2018-12-13 13:05:47 +01:00
parent 310adc18c6
commit 2c8bc7283e
2 changed files with 8 additions and 2 deletions

View File

@ -512,8 +512,6 @@ void ObjectList::OnDrop(wxDataViewEvent &event)
parts_changed(m_selected_object_id);
m_dragged_data.clear();
// m_prevent_list_events = false;
}
@ -1453,6 +1451,12 @@ void ObjectList::update_selections()
}
select_items(sels);
if (GetSelection()) {
const int sel_item_row = GetRowByItem(GetSelection());
ScrollLines(sel_item_row - m_selected_row);
m_selected_row = sel_item_row;
}
}
void ObjectList::update_selections_on_canvas()

View File

@ -108,6 +108,8 @@ class ObjectList : public wxDataViewCtrl
bool m_parts_changed = false;
bool m_part_settings_changed = false;
int m_selected_row = 0;
public:
ObjectList(wxWindow* parent);
~ObjectList();