summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--Base/etc/WindowServer/WindowServer.ini1
-rw-r--r--Base/res/cursors/crosshair.pngbin0 -> 142 bytes
-rw-r--r--Demos/WidgetGallery/main.cpp4
-rw-r--r--Libraries/LibGfx/StandardCursor.h1
-rw-r--r--Services/WindowServer/Cursor.cpp2
-rw-r--r--Services/WindowServer/WindowManager.cpp1
-rw-r--r--Services/WindowServer/WindowManager.h2
7 files changed, 11 insertions, 0 deletions
diff --git a/Base/etc/WindowServer/WindowServer.ini b/Base/etc/WindowServer/WindowServer.ini
index 1c01de478b..37bdcee053 100644
--- a/Base/etc/WindowServer/WindowServer.ini
+++ b/Base/etc/WindowServer/WindowServer.ini
@@ -20,6 +20,7 @@ Hand=/res/cursors/hand.png
Help=/res/cursors/help.png
Drag=/res/cursors/drag.png
Wait=/res/cursors/wait.png
+Crosshair=/res/cursors/crosshair.png
[Input]
DoubleClickSpeed=250
diff --git a/Base/res/cursors/crosshair.png b/Base/res/cursors/crosshair.png
new file mode 100644
index 0000000000..84e6b395ab
--- /dev/null
+++ b/Base/res/cursors/crosshair.png
Binary files differ
diff --git a/Demos/WidgetGallery/main.cpp b/Demos/WidgetGallery/main.cpp
index daf5317b75..5047034d97 100644
--- a/Demos/WidgetGallery/main.cpp
+++ b/Demos/WidgetGallery/main.cpp
@@ -521,6 +521,10 @@ int main(int argc, char** argv)
radio_cursor_arrow.on_checked = [&](bool) {
window->set_cursor(Gfx::StandardCursor::Arrow);
};
+ auto& radio_crosshair_arrow = cursor_group_box.add<GUI::RadioButton>("Crosshair");
+ radio_crosshair_arrow.on_checked = [&](bool) {
+ window->set_cursor(Gfx::StandardCursor::Crosshair);
+ };
auto& radio_cursor_i_beam = cursor_group_box.add<GUI::RadioButton>("IBeam");
radio_cursor_i_beam.on_checked = [&](bool) {
window->set_cursor(Gfx::StandardCursor::IBeam);
diff --git a/Libraries/LibGfx/StandardCursor.h b/Libraries/LibGfx/StandardCursor.h
index 09a8206c01..a1125e06d5 100644
--- a/Libraries/LibGfx/StandardCursor.h
+++ b/Libraries/LibGfx/StandardCursor.h
@@ -31,6 +31,7 @@ namespace Gfx {
enum class StandardCursor {
None = 0,
Arrow,
+ Crosshair,
IBeam,
ResizeHorizontal,
ResizeVertical,
diff --git a/Services/WindowServer/Cursor.cpp b/Services/WindowServer/Cursor.cpp
index c1c34df804..d69ec8a14c 100644
--- a/Services/WindowServer/Cursor.cpp
+++ b/Services/WindowServer/Cursor.cpp
@@ -56,6 +56,8 @@ RefPtr<Cursor> Cursor::create(Gfx::StandardCursor standard_cursor)
return nullptr;
case Gfx::StandardCursor::Arrow:
return WindowManager::the().arrow_cursor();
+ case Gfx::StandardCursor::Crosshair:
+ return WindowManager::the().crosshair_cursor();
case Gfx::StandardCursor::IBeam:
return WindowManager::the().i_beam_cursor();
case Gfx::StandardCursor::ResizeHorizontal:
diff --git a/Services/WindowServer/WindowManager.cpp b/Services/WindowServer/WindowManager.cpp
index a53a38480d..668a0b1580 100644
--- a/Services/WindowServer/WindowManager.cpp
+++ b/Services/WindowServer/WindowManager.cpp
@@ -126,6 +126,7 @@ void WindowManager::reload_config(bool set_screen)
m_move_cursor = get_cursor("Move");
m_drag_cursor = get_cursor("Drag");
m_wait_cursor = get_cursor("Wait");
+ m_crosshair_cursor = get_cursor("Crosshair");
}
const Gfx::Font& WindowManager::font() const
diff --git a/Services/WindowServer/WindowManager.h b/Services/WindowServer/WindowManager.h
index 86e33f2b0a..96c1ada58b 100644
--- a/Services/WindowServer/WindowManager.h
+++ b/Services/WindowServer/WindowManager.h
@@ -124,6 +124,7 @@ public:
const Cursor& active_cursor() const;
const Cursor& arrow_cursor() const { return *m_arrow_cursor; }
+ const Cursor& crosshair_cursor() const { return *m_crosshair_cursor; }
const Cursor& hand_cursor() const { return *m_hand_cursor; }
const Cursor& help_cursor() const { return *m_help_cursor; }
const Cursor& resize_horizontally_cursor() const { return *m_resize_horizontally_cursor; }
@@ -260,6 +261,7 @@ private:
RefPtr<Cursor> m_move_cursor;
RefPtr<Cursor> m_drag_cursor;
RefPtr<Cursor> m_wait_cursor;
+ RefPtr<Cursor> m_crosshair_cursor;
InlineLinkedList<Window> m_windows_in_order;