mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 15:32:46 +00:00 
			
		
		
		
	LibGUI: StackWidget should not steal focus when switching active child
Only focus the new active child if the old one had focus previously.
This commit is contained in:
		
							parent
							
								
									65b246aaf4
								
							
						
					
					
						commit
						9b89303767
					
				
					 1 changed files with 4 additions and 1 deletions
				
			
		|  | @ -42,12 +42,15 @@ void StackWidget::set_active_widget(Widget* widget) | |||
|     if (widget == m_active_widget) | ||||
|         return; | ||||
| 
 | ||||
|     bool had_focus = is_focused() || (m_active_widget && m_active_widget->is_focused()); | ||||
| 
 | ||||
|     if (m_active_widget) | ||||
|         m_active_widget->set_visible(false); | ||||
|     m_active_widget = widget; | ||||
|     if (m_active_widget) { | ||||
|         m_active_widget->set_relative_rect(rect()); | ||||
|         m_active_widget->set_focus(true); | ||||
|         if (had_focus) | ||||
|             m_active_widget->set_focus(true); | ||||
|         m_active_widget->set_visible(true); | ||||
|     } | ||||
|     if (on_active_widget_change) | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andreas Kling
						Andreas Kling