mirror of
				https://github.com/SoftFever/OrcaSlicer.git
				synced 2025-10-30 20:21:12 -06:00 
			
		
		
		
	Scroll the Object List to selected item been visible in the list (after object/part selection from the 3DScene)
This commit is contained in:
		
							parent
							
								
									310adc18c6
								
							
						
					
					
						commit
						2c8bc7283e
					
				
					 2 changed files with 8 additions and 2 deletions
				
			
		|  | @ -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() | ||||
|  |  | |||
|  | @ -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(); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 YuSanka
						YuSanka