2020-12-29 21:38:13 +00:00
|
|
|
/*
|
2021-04-22 20:40:43 +00:00
|
|
|
* Copyright (c) 2020, Idan Horowitz <idan.horowitz@serenityos.org>
|
2021-04-28 20:46:44 +00:00
|
|
|
* Copyright (c) 2021, the SerenityOS developers.
|
2021-07-20 19:35:00 +00:00
|
|
|
* Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
|
2022-04-21 14:12:09 +00:00
|
|
|
* Copyright (c) 2021-2022, Sam Atkins <atkinssj@serenityos.org>
|
2022-06-04 19:41:13 +00:00
|
|
|
* Copyright (c) 2022, MacDue <macdue@dueutil.tech>
|
2020-12-29 21:38:13 +00:00
|
|
|
*
|
2021-04-22 08:24:48 +00:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-12-29 21:38:13 +00:00
|
|
|
*/
|
|
|
|
|
2022-06-04 19:41:13 +00:00
|
|
|
#include "HighlightWidget.h"
|
2021-11-20 15:09:28 +00:00
|
|
|
#include "MouseWidget.h"
|
|
|
|
#include "ThemeWidget.h"
|
2022-04-21 14:34:53 +00:00
|
|
|
#include <LibCore/ArgsParser.h>
|
2021-11-23 22:08:57 +00:00
|
|
|
#include <LibCore/System.h>
|
2020-12-29 21:38:13 +00:00
|
|
|
#include <LibGUI/Application.h>
|
|
|
|
#include <LibGUI/Icon.h>
|
2021-11-20 15:09:28 +00:00
|
|
|
#include <LibGUI/SettingsWindow.h>
|
2021-11-23 22:08:57 +00:00
|
|
|
#include <LibMain/Main.h>
|
2020-12-29 21:38:13 +00:00
|
|
|
|
2021-11-23 22:08:57 +00:00
|
|
|
ErrorOr<int> serenity_main(Main::Arguments arguments)
|
2020-12-29 21:38:13 +00:00
|
|
|
{
|
2021-11-27 22:26:34 +00:00
|
|
|
TRY(Core::System::pledge("stdio cpath rpath recvfd sendfd unix"));
|
2020-12-29 21:38:13 +00:00
|
|
|
|
2023-05-05 04:24:53 +00:00
|
|
|
auto app = TRY(GUI::Application::create(arguments));
|
2020-12-29 21:38:13 +00:00
|
|
|
|
2021-11-27 22:26:34 +00:00
|
|
|
TRY(Core::System::pledge("stdio cpath rpath recvfd sendfd"));
|
2020-12-29 21:38:13 +00:00
|
|
|
|
2022-04-21 14:34:53 +00:00
|
|
|
StringView selected_tab;
|
|
|
|
Core::ArgsParser args_parser;
|
2022-06-04 19:41:13 +00:00
|
|
|
args_parser.add_option(selected_tab, "Tab, one of 'cursor-theme', 'cursor-highlight', or 'mouse'", "open-tab", 't', "tab");
|
2022-04-21 14:34:53 +00:00
|
|
|
args_parser.parse(arguments);
|
|
|
|
|
2022-07-11 17:32:29 +00:00
|
|
|
auto app_icon = GUI::Icon::default_icon("app-mouse"sv);
|
2021-04-02 14:08:18 +00:00
|
|
|
|
2021-11-28 07:34:04 +00:00
|
|
|
auto window = TRY(GUI::SettingsWindow::create("Mouse Settings", GUI::SettingsWindow::ShowDefaultsButton::Yes));
|
2024-03-31 07:28:48 +00:00
|
|
|
(void)TRY(window->add_tab<MouseSettings::MouseWidget>("Mouse"_string, "mouse"sv));
|
|
|
|
(void)TRY(window->add_tab<MouseSettings::ThemeWidget>("Cursor Theme"_string, "cursor-theme"sv));
|
|
|
|
(void)TRY(window->add_tab<MouseSettings::HighlightWidget>("Cursor Highlight"_string, "cursor-highlight"sv));
|
2022-06-04 19:41:13 +00:00
|
|
|
|
2020-12-29 21:38:13 +00:00
|
|
|
window->set_icon(app_icon.bitmap_for_size(16));
|
2022-04-21 14:34:53 +00:00
|
|
|
window->set_active_tab(selected_tab);
|
2020-12-29 21:38:13 +00:00
|
|
|
|
|
|
|
window->show();
|
|
|
|
return app->exec();
|
|
|
|
}
|