mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 19:22:45 +00:00 
			
		
		
		
	SystemMenu: Add icons for categories
This commit is contained in:
		
							parent
							
								
									404981a892
								
							
						
					
					
						commit
						a9d30a59d9
					
				
					 2 changed files with 15 additions and 0 deletions
				
			
		
							
								
								
									
										9
									
								
								Base/res/icons/SystemMenu.ini
									
										
									
									
									
										Normal file
									
								
							
							
						
						
									
										9
									
								
								Base/res/icons/SystemMenu.ini
									
										
									
									
									
										Normal file
									
								
							|  | @ -0,0 +1,9 @@ | |||
| [16x16] | ||||
| Demos=/res/icons/16x16/app-demo.png | ||||
| #Development= | ||||
| #Games= | ||||
| #Graphics= | ||||
| #Internet= | ||||
| Settings=/res/icons/gear16.png | ||||
| Sound=/res/icons/16x16/filetype-music.png | ||||
| #Utilities= | ||||
|  | @ -132,10 +132,16 @@ NonnullRefPtr<GUI::Menu> build_system_menu() | |||
| 
 | ||||
|     // First we construct all the necessary app category submenus.
 | ||||
|     HashMap<String, NonnullRefPtr<GUI::Menu>> app_category_menus; | ||||
|     auto category_icons = Core::ConfigFile::open("/res/icons/SystemMenu.ini"); | ||||
|     for (const auto& category : sorted_app_categories) { | ||||
|         if (app_category_menus.contains(category)) | ||||
|             continue; | ||||
|         auto& category_menu = system_menu->add_submenu(category); | ||||
|         auto category_icon_path = category_icons->read_entry("16x16", category); | ||||
|         if (!category_icon_path.is_empty()) { | ||||
|             auto icon = Gfx::Bitmap::load_from_file(category_icon_path); | ||||
|             category_menu.set_icon(icon); | ||||
|         } | ||||
|         app_category_menus.set(category, category_menu); | ||||
|     } | ||||
| 
 | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Ben Wiederhake
						Ben Wiederhake