diff options
author | Marco Cutecchia <marco.cutecchia@outlook.it> | 2021-10-15 22:24:41 +0200 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-10-31 12:37:49 +0100 |
commit | 116bb4888fb7c7f5c80091caca6f3cdf68ef6383 (patch) | |
tree | afa59f7b21d9d88f96c4176af3c1a9b850ce745a /Userland/Libraries/LibGUI/Window.h | |
parent | 4bfe060336b96926dfd72bc3b0ef0b7ffdf5e168 (diff) | |
download | serenity-116bb4888fb7c7f5c80091caca6f3cdf68ef6383.zip |
LibGUI: Support using a bitmap as override cursor
Diffstat (limited to 'Userland/Libraries/LibGUI/Window.h')
-rw-r--r-- | Userland/Libraries/LibGUI/Window.h | 10 |
1 files changed, 6 insertions, 4 deletions
diff --git a/Userland/Libraries/LibGUI/Window.h b/Userland/Libraries/LibGUI/Window.h index 119a5529b7..6723b9ee09 100644 --- a/Userland/Libraries/LibGUI/Window.h +++ b/Userland/Libraries/LibGUI/Window.h @@ -9,6 +9,7 @@ #include <AK/Function.h> #include <AK/OwnPtr.h> #include <AK/String.h> +#include <AK/Variant.h> #include <AK/WeakPtr.h> #include <LibCore/Object.h> #include <LibGUI/FocusSource.h> @@ -169,7 +170,7 @@ public: void set_resize_aspect_ratio(const Optional<Gfx::IntSize>& ratio); void set_cursor(Gfx::StandardCursor); - void set_cursor(const Gfx::Bitmap&); + void set_cursor(NonnullRefPtr<Gfx::Bitmap>); void set_icon(const Gfx::Bitmap*); void apply_icon(); @@ -240,6 +241,8 @@ private: void flip(const Vector<Gfx::IntRect, 32>& dirty_rects); void force_update(); + bool are_cursors_the_same(AK::Variant<Gfx::StandardCursor, NonnullRefPtr<Gfx::Bitmap>> const&, AK::Variant<Gfx::StandardCursor, NonnullRefPtr<Gfx::Bitmap>> const&) const; + WeakPtr<Widget> m_previously_focused_widget; OwnPtr<WindowBackingStore> m_front_store; @@ -248,7 +251,6 @@ private: NonnullRefPtr<Menubar> m_menubar; RefPtr<Gfx::Bitmap> m_icon; - RefPtr<Gfx::Bitmap> m_custom_cursor; int m_window_id { 0 }; float m_opacity_when_windowless { 1.0f }; float m_alpha_hit_threshold { 0.0f }; @@ -265,8 +267,8 @@ private: Gfx::IntSize m_base_size; Color m_background_color { Color::WarmGray }; WindowType m_window_type { WindowType::Normal }; - Gfx::StandardCursor m_cursor { Gfx::StandardCursor::None }; - Gfx::StandardCursor m_effective_cursor { Gfx::StandardCursor::None }; + AK::Variant<Gfx::StandardCursor, NonnullRefPtr<Gfx::Bitmap>> m_cursor { Gfx::StandardCursor::None }; + AK::Variant<Gfx::StandardCursor, NonnullRefPtr<Gfx::Bitmap>> m_effective_cursor { Gfx::StandardCursor::None }; bool m_is_active_input { false }; bool m_has_alpha_channel { false }; bool m_double_buffering_enabled { true }; |