1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-28 07:17:34 +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

@ -0,0 +1,42 @@
/*
* Copyright (c) 2022, MacDue <macdue@dueutil.tech>
*
* SPDX-License-Identifier: BSD-2-Clause
*/
#pragma once
#include <LibGUI/AbstractThemePreview.h>
#include <LibGfx/Color.h>
namespace MouseSettings {
class HighlightPreviewWidget final : public GUI::AbstractThemePreview {
C_OBJECT(HighlightPreviewWidget)
public:
virtual ~HighlightPreviewWidget() override = default;
virtual void paint_preview(GUI::PaintEvent&) override;
void set_radius(int radius)
{
m_radius = radius;
update();
}
void set_color(Gfx::Color const& color)
{
m_color = color;
update();
}
private:
explicit HighlightPreviewWidget(Gfx::Palette const& palette);
RefPtr<Gfx::Bitmap> m_cursor_bitmap;
int m_radius { 0 };
Gfx::Color m_color;
};
}