mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 12:12:45 +00:00 
			
		
		
		
	GComboBox: Constrain the list popup window height to the desktop rect
This looks much better than allowing it to extend past the bottom of the screen. :^)
This commit is contained in:
		
							parent
							
								
									f2fbb90dae
								
							
						
					
					
						commit
						7c0f9ea2b9
					
				
					 1 changed files with 5 additions and 1 deletions
				
			
		|  | @ -1,5 +1,6 @@ | |||
| #include <LibGUI/GButton.h> | ||||
| #include <LibGUI/GComboBox.h> | ||||
| #include <LibGUI/GDesktop.h> | ||||
| #include <LibGUI/GListView.h> | ||||
| #include <LibGUI/GScrollBar.h> | ||||
| #include <LibGUI/GTextEditor.h> | ||||
|  | @ -90,7 +91,10 @@ void GComboBox::open() | |||
|         model()->row_count() * m_list_view->item_height() + m_list_view->frame_thickness() * 2 | ||||
|     }; | ||||
| 
 | ||||
|     m_list_window->set_rect({ my_screen_rect.bottom_left(), size }); | ||||
|     Rect list_window_rect { my_screen_rect.bottom_left(), size }; | ||||
|     list_window_rect.intersect(GDesktop::the().rect().shrunken(0, 128)); | ||||
| 
 | ||||
|     m_list_window->set_rect(list_window_rect); | ||||
|     m_list_window->show(); | ||||
| } | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andreas Kling
						Andreas Kling