mirror of
				https://github.com/LadybirdBrowser/ladybird.git
				synced 2025-11-04 15:20:58 +00:00 
			
		
		
		
	LibGUI: Only consider starting a drag from an already selected item
This means we can deselect other items immediately when performing a mouse-down on an unselected item.
This commit is contained in:
		
							parent
							
								
									f9b4d981a8
								
							
						
					
					
						commit
						831ff2d0ac
					
				
				
				Notes:
				
					sideshowbarker
				
				2024-07-19 09:45:35 +09:00 
				
			
			Author: https://github.com/bugaevc
Commit: 831ff2d0ac
Pull-request: https://github.com/SerenityOS/serenity/pull/1147
			
					 1 changed files with 1 additions and 2 deletions
				
			
		| 
						 | 
				
			
			@ -191,10 +191,9 @@ void GAbstractView::mousedown_event(GMouseEvent& event)
 | 
			
		|||
        m_selection.clear();
 | 
			
		||||
    } else if (event.modifiers() & Mod_Ctrl) {
 | 
			
		||||
        m_selection.toggle(index);
 | 
			
		||||
    } else if (event.button() == GMouseButton::Left && !m_model->drag_data_type().is_null()) {
 | 
			
		||||
    } else if (event.button() == GMouseButton::Left && m_selection.contains(index) && !m_model->drag_data_type().is_null()) {
 | 
			
		||||
        // We might be starting a drag, so don't throw away other selected items yet.
 | 
			
		||||
        m_might_drag = true;
 | 
			
		||||
        m_selection.add(index);
 | 
			
		||||
    } else {
 | 
			
		||||
        m_selection.set(index);
 | 
			
		||||
    }
 | 
			
		||||
| 
						 | 
				
			
			
 | 
			
		|||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue