mirror of
				https://github.com/RGBCube/serenity
				synced 2025-10-31 21:22:46 +00:00 
			
		
		
		
	MouseSettings: Port to LibMain :^)
This commit is contained in:
		
							parent
							
								
									788be69bcd
								
							
						
					
					
						commit
						10b5393506
					
				
					 2 changed files with 8 additions and 14 deletions
				
			
		|  | @ -19,4 +19,4 @@ set(SOURCES | ||||||
| ) | ) | ||||||
| 
 | 
 | ||||||
| serenity_app(MouseSettings ICON app-mouse) | serenity_app(MouseSettings ICON app-mouse) | ||||||
| target_link_libraries(MouseSettings LibGUI) | target_link_libraries(MouseSettings LibGUI LibMain) | ||||||
|  |  | ||||||
|  | @ -9,29 +9,23 @@ | ||||||
| 
 | 
 | ||||||
| #include "MouseWidget.h" | #include "MouseWidget.h" | ||||||
| #include "ThemeWidget.h" | #include "ThemeWidget.h" | ||||||
| #include <LibGUI/Action.h> | #include <LibCore/System.h> | ||||||
| #include <LibGUI/Application.h> | #include <LibGUI/Application.h> | ||||||
| #include <LibGUI/Icon.h> | #include <LibGUI/Icon.h> | ||||||
| #include <LibGUI/SettingsWindow.h> | #include <LibGUI/SettingsWindow.h> | ||||||
| #include <unistd.h> | #include <LibMain/Main.h> | ||||||
| 
 | 
 | ||||||
| int main(int argc, char** argv) | ErrorOr<int> serenity_main(Main::Arguments arguments) | ||||||
| { | { | ||||||
|     if (pledge("stdio cpath rpath recvfd sendfd unix", nullptr) < 0) { |     TRY(Core::System::pledge("stdio cpath rpath recvfd sendfd unix", nullptr)); | ||||||
|         perror("pledge"); |  | ||||||
|         return 1; |  | ||||||
|     } |  | ||||||
| 
 | 
 | ||||||
|     auto app = GUI::Application::construct(argc, argv); |     auto app = TRY(GUI::Application::try_create(arguments)); | ||||||
| 
 | 
 | ||||||
|     if (pledge("stdio cpath rpath recvfd sendfd", nullptr) < 0) { |     TRY(Core::System::pledge("stdio cpath rpath recvfd sendfd", nullptr)); | ||||||
|         perror("pledge"); |  | ||||||
|         return 1; |  | ||||||
|     } |  | ||||||
| 
 | 
 | ||||||
|     auto app_icon = GUI::Icon::default_icon("app-mouse"); |     auto app_icon = GUI::Icon::default_icon("app-mouse"); | ||||||
| 
 | 
 | ||||||
|     auto window = GUI::SettingsWindow::construct("Mouse Settings", GUI::SettingsWindow::ShowDefaultsButton::Yes); |     auto window = TRY(GUI::SettingsWindow::try_create("Mouse Settings", GUI::SettingsWindow::ShowDefaultsButton::Yes)); | ||||||
|     window->add_tab<MouseWidget>("Mouse"); |     window->add_tab<MouseWidget>("Mouse"); | ||||||
|     window->add_tab<ThemeWidget>("Cursor Theme"); |     window->add_tab<ThemeWidget>("Cursor Theme"); | ||||||
|     window->set_icon(app_icon.bitmap_for_size(16)); |     window->set_icon(app_icon.bitmap_for_size(16)); | ||||||
|  |  | ||||||
		Loading…
	
	Add table
		Add a link
		
	
		Reference in a new issue
	
	 Andreas Kling
						Andreas Kling