summaryrefslogtreecommitdiff
path: root/Userland
diff options
context:
space:
mode:
authorMustafa Quraish <mustafaq9@gmail.com>2021-08-31 22:19:31 -0400
committerAndreas Kling <kling@serenityos.org>2021-09-04 03:35:23 +0200
commit30e91ecff6d1e5ad033a92983502315710392041 (patch)
tree06ac5435d0a9da71edcaf5a4802e0c066e2f2e54 /Userland
parent30ce1d856292a025b5f0e1fd1e4ddbbd6991b8c5 (diff)
downloadserenity-30e91ecff6d1e5ad033a92983502315710392041.zip
Cursors: Add new Magnifying glass cursor
There are a few places in the system where this could be useful, such as PixelPaint and the MandelBrot demo. It seems general enough that it is probably useful to have it as a system-wide cursor rather than loading it manually each time.
Diffstat (limited to 'Userland')
-rw-r--r--Userland/Libraries/LibGfx/StandardCursor.h1
-rw-r--r--Userland/Services/WindowServer/Cursor.cpp2
-rw-r--r--Userland/Services/WindowServer/WindowManager.cpp1
-rw-r--r--Userland/Services/WindowServer/WindowManager.h2
4 files changed, 6 insertions, 0 deletions
diff --git a/Userland/Libraries/LibGfx/StandardCursor.h b/Userland/Libraries/LibGfx/StandardCursor.h
index 1e15852dbf..9a8a9c97b6 100644
--- a/Userland/Libraries/LibGfx/StandardCursor.h
+++ b/Userland/Libraries/LibGfx/StandardCursor.h
@@ -27,6 +27,7 @@ enum class StandardCursor {
Wait,
Disallowed,
Eyedropper,
+ Zoom,
__Count,
};
diff --git a/Userland/Services/WindowServer/Cursor.cpp b/Userland/Services/WindowServer/Cursor.cpp
index 18fc08f6a3..07ce2ab1f8 100644
--- a/Userland/Services/WindowServer/Cursor.cpp
+++ b/Userland/Services/WindowServer/Cursor.cpp
@@ -111,6 +111,8 @@ RefPtr<Cursor> Cursor::create(Gfx::StandardCursor standard_cursor)
return WindowManager::the().disallowed_cursor();
case Gfx::StandardCursor::Eyedropper:
return WindowManager::the().eyedropper_cursor();
+ case Gfx::StandardCursor::Zoom:
+ return WindowManager::the().zoom_cursor();
default:
VERIFY_NOT_REACHED();
}
diff --git a/Userland/Services/WindowServer/WindowManager.cpp b/Userland/Services/WindowServer/WindowManager.cpp
index be415582c2..c816377c71 100644
--- a/Userland/Services/WindowServer/WindowManager.cpp
+++ b/Userland/Services/WindowServer/WindowManager.cpp
@@ -2081,6 +2081,7 @@ void WindowManager::apply_cursor_theme(const String& theme_name)
reload_cursor(m_wait_cursor, "Wait");
reload_cursor(m_crosshair_cursor, "Crosshair");
reload_cursor(m_eyedropper_cursor, "Eyedropper");
+ reload_cursor(m_zoom_cursor, "Zoom");
Compositor::the().invalidate_cursor();
m_config->write_entry("Mouse", "CursorTheme", theme_name);
diff --git a/Userland/Services/WindowServer/WindowManager.h b/Userland/Services/WindowServer/WindowManager.h
index ccfd363e06..98dd20ec0f 100644
--- a/Userland/Services/WindowServer/WindowManager.h
+++ b/Userland/Services/WindowServer/WindowManager.h
@@ -151,6 +151,7 @@ public:
Cursor const& drag_cursor() const { return *m_drag_cursor; }
Cursor const& wait_cursor() const { return *m_wait_cursor; }
Cursor const& eyedropper_cursor() const { return *m_eyedropper_cursor; }
+ Cursor const& zoom_cursor() const { return *m_zoom_cursor; }
Gfx::Font const& font() const;
Gfx::Font const& window_title_font() const;
@@ -366,6 +367,7 @@ private:
RefPtr<Cursor> m_wait_cursor;
RefPtr<Cursor> m_crosshair_cursor;
RefPtr<Cursor> m_eyedropper_cursor;
+ RefPtr<Cursor> m_zoom_cursor;
RefPtr<MultiScaleBitmaps> m_overlay_rect_shadow;