2020-01-18 09:38:21 +01:00
|
|
|
/*
|
2020-02-26 22:02:25 +11:00
|
|
|
* Copyright (c) 2019-2020, Jesse Buhagiar <jooster669@gmail.com>
|
2021-05-18 22:21:56 +02:00
|
|
|
* Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
|
2022-04-21 15:12:09 +01:00
|
|
|
* Copyright (c) 2021-2022, Sam Atkins <atkinssj@serenityos.org>
|
2020-01-18 09:38:21 +01:00
|
|
|
*
|
2021-04-22 01:24:48 -07:00
|
|
|
* SPDX-License-Identifier: BSD-2-Clause
|
2020-01-18 09:38:21 +01:00
|
|
|
*/
|
|
|
|
|
|
2021-05-19 21:19:09 +02:00
|
|
|
#include "BackgroundSettingsWidget.h"
|
2021-06-30 11:28:16 -06:00
|
|
|
#include "DesktopSettingsWidget.h"
|
2021-05-21 18:55:30 +02:00
|
|
|
#include "FontSettingsWidget.h"
|
2021-05-19 21:43:54 +02:00
|
|
|
#include "MonitorSettingsWidget.h"
|
2022-03-27 20:32:32 +01:00
|
|
|
#include "ThemesSettingsWidget.h"
|
2021-08-29 10:05:41 -04:00
|
|
|
#include <LibConfig/Client.h>
|
2021-11-27 12:49:54 +01:00
|
|
|
#include <LibCore/System.h>
|
2020-02-06 20:33:02 +01:00
|
|
|
#include <LibGUI/Application.h>
|
2020-11-02 19:30:17 +00:00
|
|
|
#include <LibGUI/Icon.h>
|
2021-11-20 15:28:46 +00:00
|
|
|
#include <LibGUI/SettingsWindow.h>
|
2021-11-27 12:49:54 +01:00
|
|
|
#include <LibMain/Main.h>
|
2019-09-03 21:45:02 +10:00
|
|
|
|
2021-11-27 12:49:54 +01:00
|
|
|
ErrorOr<int> serenity_main(Main::Arguments arguments)
|
2019-09-03 21:45:02 +10:00
|
|
|
{
|
2021-11-27 12:49:54 +01:00
|
|
|
TRY(Core::System::pledge("stdio thread recvfd sendfd rpath cpath wpath unix"));
|
2020-01-13 12:22:49 +01:00
|
|
|
|
2021-11-27 12:49:54 +01:00
|
|
|
auto app = TRY(GUI::Application::try_create(arguments));
|
2022-02-11 17:33:09 +01:00
|
|
|
Config::pledge_domain("WindowManager");
|
2020-01-13 12:22:49 +01:00
|
|
|
|
2020-11-02 19:30:17 +00:00
|
|
|
auto app_icon = GUI::Icon::default_icon("app-display-settings");
|
|
|
|
|
|
2022-04-03 10:51:54 +01:00
|
|
|
bool background_settings_changed = false;
|
|
|
|
|
|
2021-11-28 08:34:04 +01:00
|
|
|
auto window = TRY(GUI::SettingsWindow::create("Display Settings"));
|
2022-04-21 15:12:09 +01:00
|
|
|
(void)TRY(window->add_tab<DisplaySettings::BackgroundSettingsWidget>("Background", "background", background_settings_changed));
|
|
|
|
|
(void)TRY(window->add_tab<DisplaySettings::ThemesSettingsWidget>("Themes", "themes", background_settings_changed));
|
|
|
|
|
(void)TRY(window->add_tab<DisplaySettings::FontSettingsWidget>("Fonts", "fonts"));
|
|
|
|
|
(void)TRY(window->add_tab<DisplaySettings::MonitorSettingsWidget>("Monitor", "monitor"));
|
|
|
|
|
(void)TRY(window->add_tab<DisplaySettings::DesktopSettingsWidget>("Workspaces", "workspaces"));
|
2019-12-29 00:59:56 +11:00
|
|
|
|
2021-05-18 22:21:56 +02:00
|
|
|
window->set_icon(app_icon.bitmap_for_size(16));
|
2019-12-29 00:59:56 +11:00
|
|
|
|
2019-09-03 21:45:02 +10:00
|
|
|
window->show();
|
2020-07-04 14:05:19 +02:00
|
|
|
return app->exec();
|
2019-09-03 21:45:02 +10:00
|
|
|
}
|