MouseSettings: Port to LibMain :^)

This commit is contained in:
Andreas Kling 2021-11-23 23:08:57 +01:00
parent 788be69bcd
commit 10b5393506
Notes: sideshowbarker 2024-07-18 00:46:02 +09:00
2 changed files with 8 additions and 14 deletions

View file

@ -19,4 +19,4 @@ set(SOURCES
)
serenity_app(MouseSettings ICON app-mouse)
target_link_libraries(MouseSettings LibGUI)
target_link_libraries(MouseSettings LibGUI LibMain)

View file

@ -9,29 +9,23 @@
#include "MouseWidget.h"
#include "ThemeWidget.h"
#include <LibGUI/Action.h>
#include <LibCore/System.h>
#include <LibGUI/Application.h>
#include <LibGUI/Icon.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) {
perror("pledge");
return 1;
}
TRY(Core::System::pledge("stdio cpath rpath recvfd sendfd unix", nullptr));
auto app = GUI::Application::construct(argc, argv);
auto app = TRY(GUI::Application::try_create(arguments));
if (pledge("stdio cpath rpath recvfd sendfd", nullptr) < 0) {
perror("pledge");
return 1;
}
TRY(Core::System::pledge("stdio cpath rpath recvfd sendfd", nullptr));
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<ThemeWidget>("Cursor Theme");
window->set_icon(app_icon.bitmap_for_size(16));