1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 06:07:34 +00:00

WindowServer: Implement cursor highlighting

This allows drawing a nice cursor highlight with an arbitrary color
and radius in the compositor. The highlight circle is, of course,
antialiased :^).
This commit is contained in:
MacDue 2022-06-04 20:35:14 +01:00 committed by Linus Groh
parent 2a49b58269
commit 29d8ec1b18
3 changed files with 55 additions and 4 deletions

View file

@ -153,6 +153,9 @@ public:
Cursor const& eyedropper_cursor() const { return *m_eyedropper_cursor; }
Cursor const& zoom_cursor() const { return *m_zoom_cursor; }
int cursor_highlight_radius() const { return m_cursor_highlight_radius; }
Gfx::Color cursor_highlight_color() const { return m_cursor_highlight_color; }
Gfx::Font const& font() const;
Gfx::Font const& window_title_font() const;
@ -323,6 +326,11 @@ public:
void apply_cursor_theme(String const& name);
void set_cursor_highlight_radius(int radius);
void set_cursor_highlight_color(Gfx::Color const& color);
bool is_cursor_highlight_enabled() const;
private:
explicit WindowManager(Gfx::PaletteImpl const&);
@ -376,6 +384,8 @@ private:
RefPtr<Cursor> m_crosshair_cursor;
RefPtr<Cursor> m_eyedropper_cursor;
RefPtr<Cursor> m_zoom_cursor;
int m_cursor_highlight_radius { 0 };
Gfx::Color m_cursor_highlight_color;
RefPtr<MultiScaleBitmaps> m_overlay_rect_shadow;