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/Widget.h | |
parent | 4bfe060336b96926dfd72bc3b0ef0b7ffdf5e168 (diff) | |
download | serenity-116bb4888fb7c7f5c80091caca6f3cdf68ef6383.zip |
LibGUI: Support using a bitmap as override cursor
Diffstat (limited to 'Userland/Libraries/LibGUI/Widget.h')
-rw-r--r-- | Userland/Libraries/LibGUI/Widget.h | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/Userland/Libraries/LibGUI/Widget.h b/Userland/Libraries/LibGUI/Widget.h index 29ae0f0079..07b870e28a 100644 --- a/Userland/Libraries/LibGUI/Widget.h +++ b/Userland/Libraries/LibGUI/Widget.h @@ -9,6 +9,7 @@ #include <AK/EnumBits.h> #include <AK/JsonObject.h> #include <AK/String.h> +#include <AK/Variant.h> #include <LibCore/Object.h> #include <LibGUI/Event.h> #include <LibGUI/FocusPolicy.h> @@ -272,8 +273,8 @@ public: virtual Gfx::IntRect children_clip_rect() const; - Gfx::StandardCursor override_cursor() const { return m_override_cursor; } - void set_override_cursor(Gfx::StandardCursor); + AK::Variant<Gfx::StandardCursor, NonnullRefPtr<Gfx::Bitmap>> override_cursor() const { return m_override_cursor; } + void set_override_cursor(AK::Variant<Gfx::StandardCursor, NonnullRefPtr<Gfx::Bitmap>>); bool load_from_gml(const StringView&); bool load_from_gml(const StringView&, RefPtr<Core::Object> (*unregistered_child_handler)(const String&)); @@ -373,7 +374,7 @@ private: WeakPtr<Widget> m_focus_proxy; FocusPolicy m_focus_policy { FocusPolicy::NoFocus }; - Gfx::StandardCursor m_override_cursor { Gfx::StandardCursor::None }; + AK::Variant<Gfx::StandardCursor, NonnullRefPtr<Gfx::Bitmap>> m_override_cursor { Gfx::StandardCursor::None }; }; inline Widget* Widget::parent_widget() |