summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorMustafa Quraish <mustafaq9@gmail.com>2021-08-31 22:16:53 -0400
committerAndreas Kling <kling@serenityos.org>2021-09-04 03:35:23 +0200
commit30ce1d856292a025b5f0e1fd1e4ddbbd6991b8c5 (patch)
tree1e128afcd24a92536ef0f64461cfabef902528af
parent81326ac8c79f97d352818ecb4381ba2d167280d5 (diff)
downloadserenity-30ce1d856292a025b5f0e1fd1e4ddbbd6991b8c5.zip
Cursors: Add new Eyedropper cursor
This can be used immediately in PixelPaint (separate commit), but I am adding this as a system-wide cursor since it may also be useful for other applications that want to use it.
-rw-r--r--Base/res/cursor-themes/Dark/Config.ini1
-rw-r--r--Base/res/cursor-themes/Dark/eyedropper.x2y2.pngbin0 -> 716 bytes
-rw-r--r--Base/res/cursor-themes/Default/Config.ini1
-rw-r--r--Base/res/cursor-themes/Default/eyedropper.x2y2.pngbin0 -> 680 bytes
-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
8 files changed, 8 insertions, 0 deletions
diff --git a/Base/res/cursor-themes/Dark/Config.ini b/Base/res/cursor-themes/Dark/Config.ini
index fec44b14a7..88cc11daae 100644
--- a/Base/res/cursor-themes/Dark/Config.ini
+++ b/Base/res/cursor-themes/Dark/Config.ini
@@ -15,3 +15,4 @@ Help=help.x1y1.png
Drag=drag.png
Wait=wait.f14t100.png
Crosshair=crosshair.png
+Eyedropper=eyedropper.x2y2.png
diff --git a/Base/res/cursor-themes/Dark/eyedropper.x2y2.png b/Base/res/cursor-themes/Dark/eyedropper.x2y2.png
new file mode 100644
index 0000000000..2d3c67584d
--- /dev/null
+++ b/Base/res/cursor-themes/Dark/eyedropper.x2y2.png
Binary files differ
diff --git a/Base/res/cursor-themes/Default/Config.ini b/Base/res/cursor-themes/Default/Config.ini
index fec44b14a7..88cc11daae 100644
--- a/Base/res/cursor-themes/Default/Config.ini
+++ b/Base/res/cursor-themes/Default/Config.ini
@@ -15,3 +15,4 @@ Help=help.x1y1.png
Drag=drag.png
Wait=wait.f14t100.png
Crosshair=crosshair.png
+Eyedropper=eyedropper.x2y2.png
diff --git a/Base/res/cursor-themes/Default/eyedropper.x2y2.png b/Base/res/cursor-themes/Default/eyedropper.x2y2.png
new file mode 100644
index 0000000000..cd6b4c6bb6
--- /dev/null
+++ b/Base/res/cursor-themes/Default/eyedropper.x2y2.png
Binary files differ
diff --git a/Userland/Libraries/LibGfx/StandardCursor.h b/Userland/Libraries/LibGfx/StandardCursor.h
index 52c4ab84d8..1e15852dbf 100644
--- a/Userland/Libraries/LibGfx/StandardCursor.h
+++ b/Userland/Libraries/LibGfx/StandardCursor.h
@@ -26,6 +26,7 @@ enum class StandardCursor {
Move,
Wait,
Disallowed,
+ Eyedropper,
__Count,
};
diff --git a/Userland/Services/WindowServer/Cursor.cpp b/Userland/Services/WindowServer/Cursor.cpp
index 4f5eda1b0b..18fc08f6a3 100644
--- a/Userland/Services/WindowServer/Cursor.cpp
+++ b/Userland/Services/WindowServer/Cursor.cpp
@@ -109,6 +109,8 @@ RefPtr<Cursor> Cursor::create(Gfx::StandardCursor standard_cursor)
return WindowManager::the().wait_cursor();
case Gfx::StandardCursor::Disallowed:
return WindowManager::the().disallowed_cursor();
+ case Gfx::StandardCursor::Eyedropper:
+ return WindowManager::the().eyedropper_cursor();
default:
VERIFY_NOT_REACHED();
}
diff --git a/Userland/Services/WindowServer/WindowManager.cpp b/Userland/Services/WindowServer/WindowManager.cpp
index eeec1d4f10..be415582c2 100644
--- a/Userland/Services/WindowServer/WindowManager.cpp
+++ b/Userland/Services/WindowServer/WindowManager.cpp
@@ -2080,6 +2080,7 @@ void WindowManager::apply_cursor_theme(const String& theme_name)
reload_cursor(m_drag_cursor, "Drag");
reload_cursor(m_wait_cursor, "Wait");
reload_cursor(m_crosshair_cursor, "Crosshair");
+ reload_cursor(m_eyedropper_cursor, "Eyedropper");
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 cb3aec1d8c..ccfd363e06 100644
--- a/Userland/Services/WindowServer/WindowManager.h
+++ b/Userland/Services/WindowServer/WindowManager.h
@@ -150,6 +150,7 @@ public:
Cursor const& move_cursor() const { return *m_move_cursor; }
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; }
Gfx::Font const& font() const;
Gfx::Font const& window_title_font() const;
@@ -364,6 +365,7 @@ private:
RefPtr<Cursor> m_drag_cursor;
RefPtr<Cursor> m_wait_cursor;
RefPtr<Cursor> m_crosshair_cursor;
+ RefPtr<Cursor> m_eyedropper_cursor;
RefPtr<MultiScaleBitmaps> m_overlay_rect_shadow;