mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 22:02:44 +00:00 
			
		
		
		
	LibGUI: Fix go_upwards_instead check in ComboBox
				
					
				
			This change addresses an issue where ComboBox list window would always be drawn upwards if the number of elements is lower or equal 3.
This commit is contained in:
		
							parent
							
								
									d91119ba78
								
							
						
					
					
						commit
						f15ad9523d
					
				
					 1 changed files with 1 additions and 1 deletions
				
			
		|  | @ -238,7 +238,7 @@ void ComboBox::open() | ||||||
|     // Change direction and go upwards to prevent the list from becoming
 |     // Change direction and go upwards to prevent the list from becoming
 | ||||||
|     // infinitesimally small when pushed up against the screen edge.
 |     // infinitesimally small when pushed up against the screen edge.
 | ||||||
|     auto minimum_height = min(3, model()->row_count()) * m_list_view->item_height() + m_list_view->frame_thickness() * 2; |     auto minimum_height = min(3, model()->row_count()) * m_list_view->item_height() + m_list_view->frame_thickness() * 2; | ||||||
|     bool go_upwards_instead = list_window_rect.height() <= minimum_height; |     bool go_upwards_instead = list_window_rect.height() < minimum_height; | ||||||
|     if (go_upwards_instead) { |     if (go_upwards_instead) { | ||||||
|         auto origin_point = my_screen_rect.top_left(); |         auto origin_point = my_screen_rect.top_left(); | ||||||
|         list_window_rect = { Gfx::IntPoint { origin_point.x(), origin_point.y() - size.height() }, size }; |         list_window_rect = { Gfx::IntPoint { origin_point.x(), origin_point.y() - size.height() }, size }; | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 LuK1337
						LuK1337