mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-01-24 02:03:06 -05:00
MouseSettings: Port to LibMain :^)
This commit is contained in:
parent
788be69bcd
commit
10b5393506
Notes:
sideshowbarker
2024-07-18 00:46:02 +09:00
Author: https://github.com/awesomekling Commit: https://github.com/SerenityOS/serenity/commit/10b53935067
2 changed files with 8 additions and 14 deletions
|
@ -19,4 +19,4 @@ set(SOURCES
|
|||
)
|
||||
|
||||
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 "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));
|
||||
|
|
Loading…
Add table
Reference in a new issue