1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 21:17:44 +00:00

MouseSettings: Add tab to configure cursor highlighting

This adds a nice little tab, including a preview, for configuring
the cursor highlighting. Which allows setting the color, size/radius,
and opacity.
This commit is contained in:
MacDue 2022-06-04 20:41:13 +01:00 committed by Linus Groh
parent 5fc13e1d53
commit b558d899ea
7 changed files with 295 additions and 1 deletions

View file

@ -3,10 +3,12 @@
* Copyright (c) 2021, the SerenityOS developers.
* Copyright (c) 2021, Andreas Kling <kling@serenityos.org>
* Copyright (c) 2021-2022, Sam Atkins <atkinssj@serenityos.org>
* Copyright (c) 2022, MacDue <macdue@dueutil.tech>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#include "HighlightWidget.h"
#include "MouseWidget.h"
#include "ThemeWidget.h"
#include <LibCore/ArgsParser.h>
@ -26,7 +28,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
StringView selected_tab;
Core::ArgsParser args_parser;
args_parser.add_option(selected_tab, "Tab, one of 'cursor-theme' or 'mouse'", "open-tab", 't', "tab");
args_parser.add_option(selected_tab, "Tab, one of 'cursor-theme', 'cursor-highlight', or 'mouse'", "open-tab", 't', "tab");
args_parser.parse(arguments);
auto app_icon = GUI::Icon::default_icon("app-mouse");
@ -34,6 +36,8 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
auto window = TRY(GUI::SettingsWindow::create("Mouse Settings", GUI::SettingsWindow::ShowDefaultsButton::Yes));
(void)TRY(window->add_tab<MouseWidget>("Mouse", "mouse"));
(void)TRY(window->add_tab<ThemeWidget>("Cursor Theme", "cursor-theme"));
(void)TRY(window->add_tab<HighlightWidget>("Cursor Highlight", "cursor-highlight"));
window->set_icon(app_icon.bitmap_for_size(16));
window->set_active_tab(selected_tab);