mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 17:52:45 +00:00 
			
		
		
		
	FileManager: Add some menus.
This commit is contained in:
		
							parent
							
								
									28da956a12
								
							
						
					
					
						commit
						f33f094483
					
				
					 1 changed files with 22 additions and 0 deletions
				
			
		|  | @ -3,6 +3,8 @@ | |||
| #include <LibGUI/GBoxLayout.h> | ||||
| #include <LibGUI/GApplication.h> | ||||
| #include <LibGUI/GStatusBar.h> | ||||
| #include <LibGUI/GMenuBar.h> | ||||
| #include <LibGUI/GAction.h> | ||||
| #include <unistd.h> | ||||
| #include <stdio.h> | ||||
| #include "DirectoryView.h" | ||||
|  | @ -13,6 +15,26 @@ int main(int argc, char** argv) | |||
| { | ||||
|     GApplication app(argc, argv); | ||||
| 
 | ||||
|     auto menubar = make<GMenuBar>(); | ||||
| 
 | ||||
|     auto app_menu = make<GMenu>("FileManager"); | ||||
|     app_menu->add_action(make<GAction>("Quit", String(), [] (const GAction&) { | ||||
|         GApplication::the().exit(0); | ||||
|         return; | ||||
|     })); | ||||
|     menubar->add_menu(move(app_menu)); | ||||
| 
 | ||||
|     auto file_menu = make<GMenu>("File"); | ||||
|     menubar->add_menu(move(file_menu)); | ||||
| 
 | ||||
|     auto help_menu = make<GMenu>("Help"); | ||||
|     help_menu->add_action(make<GAction>("About", [] (const GAction&) { | ||||
|         dbgprintf("FIXME: Implement Help/About\n"); | ||||
|     })); | ||||
|     menubar->add_menu(move(help_menu)); | ||||
| 
 | ||||
|     app.set_menubar(move(menubar)); | ||||
| 
 | ||||
|     auto* window = make_window(); | ||||
|     window->set_should_exit_app_on_close(true); | ||||
|     window->show(); | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andreas Kling
						Andreas Kling