mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 09:22:44 +00:00 
			
		
		
		
	Applications: Implement some missing MenuBars & AboutDialogs
This commit is contained in:
		
							parent
							
								
									33b8d37dd3
								
							
						
					
					
						commit
						74a18c86c9
					
				
					 7 changed files with 80 additions and 7 deletions
				
			
		|  | @ -1,6 +1,9 @@ | |||
| #include "FontEditor.h" | ||||
| #include <LibDraw/PNGLoader.h> | ||||
| #include <LibGUI/GAboutDialog.h> | ||||
| #include <LibGUI/GAction.h> | ||||
| #include <LibGUI/GApplication.h> | ||||
| #include <LibGUI/GMenuBar.h> | ||||
| #include <LibGUI/GWindow.h> | ||||
| #include <stdio.h> | ||||
| 
 | ||||
|  | @ -28,9 +31,28 @@ int main(int argc, char** argv) | |||
|     auto window = GWindow::construct(); | ||||
|     window->set_title("Font Editor"); | ||||
|     window->set_rect({ 50, 50, 390, 342 }); | ||||
| 
 | ||||
|     auto font_editor = FontEditorWidget::construct(path, move(edited_font)); | ||||
|     window->set_main_widget(font_editor); | ||||
|     window->show(); | ||||
|     window->set_icon(load_png("/res/icons/16x16/app-font-editor.png")); | ||||
| 
 | ||||
|     auto menubar = make<GMenuBar>(); | ||||
| 
 | ||||
|     auto app_menu = GMenu::construct("Font Editor"); | ||||
|     app_menu->add_action(GCommonActions::make_quit_action([](auto&) { | ||||
|         GApplication::the().quit(0); | ||||
|         return; | ||||
|     })); | ||||
|     menubar->add_menu(move(app_menu)); | ||||
| 
 | ||||
|     auto help_menu = GMenu::construct("Help"); | ||||
|     help_menu->add_action(GAction::create("About", [&](const GAction&) { | ||||
|         GAboutDialog::show("Font Editor", load_png("/res/icons/FontEditor.png"), window); | ||||
|     })); | ||||
|     menubar->add_menu(move(help_menu)); | ||||
| 
 | ||||
|     app.set_menubar(move(menubar)); | ||||
| 
 | ||||
|     return app.exec(); | ||||
| } | ||||
|  |  | |||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Jami Kettunen
						Jami Kettunen