From 76266862d19cab8d3127a90c4281f99c7e4d8269 Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Thu, 10 Oct 2019 21:35:12 +0200 Subject: [PATCH] LibGUI+WindowServer: Add a "Hand" cursor to the standard cursors --- Base/home/anon/WindowManager.ini | 1 + Base/res/cursors/hand.png | Bin 0 -> 241 bytes Libraries/LibGUI/GWindow.h | 1 + Servers/WindowServer/WSCursor.cpp | 2 ++ Servers/WindowServer/WSCursor.h | 1 + Servers/WindowServer/WSWindowManager.cpp | 1 + Servers/WindowServer/WSWindowManager.h | 2 ++ 7 files changed, 8 insertions(+) create mode 100644 Base/res/cursors/hand.png diff --git a/Base/home/anon/WindowManager.ini b/Base/home/anon/WindowManager.ini index e4b29dab4a..3d9bc70bb1 100644 --- a/Base/home/anon/WindowManager.ini +++ b/Base/home/anon/WindowManager.ini @@ -11,6 +11,7 @@ ResizeDBLTR=/res/cursors/resize-diagonal-bltr.png IBeam=/res/cursors/i-beam.png Disallowed=/res/cursors/disallowed.png Move=/res/cursors/move.png +Hand=/res/cursors/hand.png [Colors] Background=50,50,50 diff --git a/Base/res/cursors/hand.png b/Base/res/cursors/hand.png new file mode 100644 index 0000000000000000000000000000000000000000..924386ef67d211e3e2ee9b15f3b1b1de6f633f45 GIT binary patch literal 241 zcmeAS@N?(olHy`uVBq!ia0y~yU=U$oU=ZVAV_;x7;J61w?eKJQ46!(Uc1koCvm%dc z|5+)nX-?A(Qg?N~s~7xRz}x&cgYC#K57ARG96YaNg!6c0V%KffKM=W}dBfQlwF68p zy{^~Wo;L3AUbyf3<&~2crk>@|dATT(Z)%{!fn-Blp|F3zCL>?K=3*^7Xz`(%Z>FVdQ&MBb@0F2yX9{>OV literal 0 HcmV?d00001 diff --git a/Libraries/LibGUI/GWindow.h b/Libraries/LibGUI/GWindow.h index ea477939e7..b33b62dfb1 100644 --- a/Libraries/LibGUI/GWindow.h +++ b/Libraries/LibGUI/GWindow.h @@ -19,6 +19,7 @@ enum class GStandardCursor { ResizeVertical, ResizeDiagonalTLBR, ResizeDiagonalBLTR, + Hand, }; class GWindow : public CObject { diff --git a/Servers/WindowServer/WSCursor.cpp b/Servers/WindowServer/WSCursor.cpp index 54f8bc8271..54b0f327d4 100644 --- a/Servers/WindowServer/WSCursor.cpp +++ b/Servers/WindowServer/WSCursor.cpp @@ -38,6 +38,8 @@ RefPtr WSCursor::create(WSStandardCursor standard_cursor) return WSWindowManager::the().resize_diagonally_tlbr_cursor(); case WSStandardCursor::ResizeDiagonalBLTR: return WSWindowManager::the().resize_diagonally_bltr_cursor(); + case WSStandardCursor::Hand: + return WSWindowManager::the().hand_cursor(); } ASSERT_NOT_REACHED(); } diff --git a/Servers/WindowServer/WSCursor.h b/Servers/WindowServer/WSCursor.h index 5b46f64674..1c0ebcbb9d 100644 --- a/Servers/WindowServer/WSCursor.h +++ b/Servers/WindowServer/WSCursor.h @@ -10,6 +10,7 @@ enum class WSStandardCursor { ResizeVertical, ResizeDiagonalTLBR, ResizeDiagonalBLTR, + Hand, }; class WSCursor : public RefCounted { diff --git a/Servers/WindowServer/WSWindowManager.cpp b/Servers/WindowServer/WSWindowManager.cpp index fa5796e827..88b3c4de0b 100644 --- a/Servers/WindowServer/WSWindowManager.cpp +++ b/Servers/WindowServer/WSWindowManager.cpp @@ -143,6 +143,7 @@ void WSWindowManager::reload_config(bool set_screen) m_wm_config->read_num_entry("Screen", "Height", 1080)); m_arrow_cursor = get_cursor("Arrow", { 2, 2 }); + m_hand_cursor = get_cursor("Hand", { 8, 4 }); m_resize_horizontally_cursor = get_cursor("ResizeH"); m_resize_vertically_cursor = get_cursor("ResizeV"); m_resize_diagonally_tlbr_cursor = get_cursor("ResizeDTLBR"); diff --git a/Servers/WindowServer/WSWindowManager.h b/Servers/WindowServer/WSWindowManager.h index f8f2b220cb..1494f595fb 100644 --- a/Servers/WindowServer/WSWindowManager.h +++ b/Servers/WindowServer/WSWindowManager.h @@ -90,6 +90,7 @@ public: const WSCursor& active_cursor() const; const WSCursor& arrow_cursor() const { return *m_arrow_cursor; } + const WSCursor& hand_cursor() const { return *m_hand_cursor; } const WSCursor& resize_horizontally_cursor() const { return *m_resize_horizontally_cursor; } const WSCursor& resize_vertically_cursor() const { return *m_resize_vertically_cursor; } const WSCursor& resize_diagonally_tlbr_cursor() const { return *m_resize_diagonally_tlbr_cursor; } @@ -180,6 +181,7 @@ private: void pick_new_active_window(); RefPtr m_arrow_cursor; + RefPtr m_hand_cursor; RefPtr m_resize_horizontally_cursor; RefPtr m_resize_vertically_cursor; RefPtr m_resize_diagonally_tlbr_cursor;