From e5674d9666527e1a1be935aeb0051fdd0184a391 Mon Sep 17 00:00:00 2001 From: Karol Kosek Date: Mon, 20 Jun 2022 11:37:22 +0200 Subject: [PATCH] Base+WindowServer+LibGfx: Add new DragCopy Cursor The purpose of this cursor is to indicate if a current dragged object (file, Spreadsheet cell) can be dropped onto a widget. --- Base/res/cursor-themes/Dark/Config.ini | 1 + Base/res/cursor-themes/Dark/drag-copy.x7y7-2x.png | Bin 0 -> 467 bytes Base/res/cursor-themes/Dark/drag-copy.x7y7.png | Bin 0 -> 188 bytes Base/res/cursor-themes/Default/Config.ini | 1 + .../cursor-themes/Default/drag-copy.x7y7-2x.png | Bin 0 -> 469 bytes Base/res/cursor-themes/Default/drag-copy.x7y7.png | Bin 0 -> 188 bytes Userland/Libraries/LibGfx/StandardCursor.h | 1 + Userland/Services/WindowServer/Cursor.cpp | 2 ++ Userland/Services/WindowServer/WindowManager.cpp | 1 + Userland/Services/WindowServer/WindowManager.h | 2 ++ 10 files changed, 8 insertions(+) create mode 100644 Base/res/cursor-themes/Dark/drag-copy.x7y7-2x.png create mode 100644 Base/res/cursor-themes/Dark/drag-copy.x7y7.png create mode 100644 Base/res/cursor-themes/Default/drag-copy.x7y7-2x.png create mode 100644 Base/res/cursor-themes/Default/drag-copy.x7y7.png diff --git a/Base/res/cursor-themes/Dark/Config.ini b/Base/res/cursor-themes/Dark/Config.ini index 7813a6b945..703130b3aa 100644 --- a/Base/res/cursor-themes/Dark/Config.ini +++ b/Base/res/cursor-themes/Dark/Config.ini @@ -13,6 +13,7 @@ Move=move.png Hand=hand.x8y4.png Help=help.x1y1.png Drag=drag.png +DragCopy=drag-copy.x7y7.png Wait=wait.f14t100.png Crosshair=crosshair.png Eyedropper=eyedropper.x2y2.png diff --git a/Base/res/cursor-themes/Dark/drag-copy.x7y7-2x.png b/Base/res/cursor-themes/Dark/drag-copy.x7y7-2x.png new file mode 100644 index 0000000000000000000000000000000000000000..a06e3126f26f6856d9035b36af77a327bc70281f GIT binary patch literal 467 zcmeAS@N?(olHy`uVBq!ia0y~yV9;P-V9?@VVPIg$w!iq6fq`+Br;B4q#jT@L&%e6t zAkeV?PjR!CLT<9i$9G3rZZFc&z9sI_dA#aHV9kH=j`lXiDQR_*9A9pqj`?Ibd*Z=4!(7WndElkcVFU#99U z`*k%q>z|F-sYk!gyg#{OZJ~yX1z$7Meall{rtDlHxOw61tEDvx9RYD?E-f{+wf}K) z-uEfxha4J}4+}0_e|7igHvc!AEWcJxnAfm;q1w>{5%rGuThiuo@Om9SVOG3Qa*DUS)BAO6> dPIu*hv2|x$s}?jGFfcGMc)I$ztaD0e0syEq)U*Hq literal 0 HcmV?d00001 diff --git a/Base/res/cursor-themes/Dark/drag-copy.x7y7.png b/Base/res/cursor-themes/Dark/drag-copy.x7y7.png new file mode 100644 index 0000000000000000000000000000000000000000..559dcb85829d54b995a15eafae137615d8e02d31 GIT binary patch literal 188 zcmeAS@N?(olHy`uVBq!ia0y~yU=U$oU=ZbCVPIf*bB9ftfq|jf)5S5Q;?~^rjhs%7 zJk1aPm$noM+jRZTmk`_h`7z@`Nc$%X4=<+|KfUI(yq6Mi zE>`!MXC1@rw~yzE_L=yE{*Mz(cJpd8@tD?fzTfiY)^-*5VCC-<``Avt^48;zX#Q2U uOZNPm4fWEqgTD2v)oooqt;HOT@yEaM44rQho$i!IdA|A||LoFw<1=q~ z>I1y`X3m*>YR2vWr8>wdV&^Gyk`#kOL z@A0b^JbC@+v8SB!Bl$TSO6v9NoL#$*7Cw63Gh=Jd-t$)sQ@mXDy}KFrwo4c-Prbs( z`ol-`*EF`>fAXBT7dUKtqPRde6dZ`rTIS( z%?l6VUaRZP(>Tf4FGNPqrH`JCG0U;X_T&I#KuQzB``^Xlu;04KM#@f&_A2F+#o fa^k|oU#yQTxkX>Ep0byLfq}u()z4*}Q$iB}stVex literal 0 HcmV?d00001 diff --git a/Base/res/cursor-themes/Default/drag-copy.x7y7.png b/Base/res/cursor-themes/Default/drag-copy.x7y7.png new file mode 100644 index 0000000000000000000000000000000000000000..4715b7857368c3822b506dff142ce357d9c632c3 GIT binary patch literal 188 zcmeAS@N?(olHy`uVBq!ia0y~yU=U$oU=ZbCVPIf*bB9ftfq|jf)5S5Q;?~@YjBJMk z1X>>2SGRoi6Yzgue|W8ec69y9b3z{^XSVpsRO+nrZd%Xjw<_P7Z<259&iNwh4`Z39 zU8tEPHK*o~>4OJ4jmB)B#cw3bOxhHEL(O5um!-8|&ZggA)T3sqx3l`G`?`Hkj^4Fd uu`PW2<1=l4@82kSZS7UFH8|bRIzP4Xe@~0@Z#xDC1_n=8KbLh*2~7a2V@-Ad literal 0 HcmV?d00001 diff --git a/Userland/Libraries/LibGfx/StandardCursor.h b/Userland/Libraries/LibGfx/StandardCursor.h index 9a8a9c97b6..d03e4a2ab3 100644 --- a/Userland/Libraries/LibGfx/StandardCursor.h +++ b/Userland/Libraries/LibGfx/StandardCursor.h @@ -23,6 +23,7 @@ enum class StandardCursor { Hand, Help, Drag, + DragCopy, Move, Wait, Disallowed, diff --git a/Userland/Services/WindowServer/Cursor.cpp b/Userland/Services/WindowServer/Cursor.cpp index 7f16bc36db..15037b0d8f 100644 --- a/Userland/Services/WindowServer/Cursor.cpp +++ b/Userland/Services/WindowServer/Cursor.cpp @@ -103,6 +103,8 @@ RefPtr Cursor::create(Gfx::StandardCursor standard_cursor) return WindowManager::the().help_cursor(); case Gfx::StandardCursor::Drag: return WindowManager::the().drag_cursor(); + case Gfx::StandardCursor::DragCopy: + return WindowManager::the().drag_copy_cursor(); case Gfx::StandardCursor::Move: return WindowManager::the().move_cursor(); case Gfx::StandardCursor::Wait: diff --git a/Userland/Services/WindowServer/WindowManager.cpp b/Userland/Services/WindowServer/WindowManager.cpp index c71818c83b..f4d7f674a1 100644 --- a/Userland/Services/WindowServer/WindowManager.cpp +++ b/Userland/Services/WindowServer/WindowManager.cpp @@ -2278,6 +2278,7 @@ void WindowManager::apply_cursor_theme(String const& theme_name) reload_cursor(m_disallowed_cursor, "Disallowed"); reload_cursor(m_move_cursor, "Move"); reload_cursor(m_drag_cursor, "Drag"); + reload_cursor(m_drag_copy_cursor, "DragCopy"); reload_cursor(m_wait_cursor, "Wait"); reload_cursor(m_crosshair_cursor, "Crosshair"); reload_cursor(m_eyedropper_cursor, "Eyedropper"); diff --git a/Userland/Services/WindowServer/WindowManager.h b/Userland/Services/WindowServer/WindowManager.h index 2b88379074..9d532d8215 100644 --- a/Userland/Services/WindowServer/WindowManager.h +++ b/Userland/Services/WindowServer/WindowManager.h @@ -149,6 +149,7 @@ public: Cursor const& disallowed_cursor() const { return *m_disallowed_cursor; } Cursor const& move_cursor() const { return *m_move_cursor; } Cursor const& drag_cursor() const { return *m_drag_cursor; } + Cursor const& drag_copy_cursor() const { return *m_drag_copy_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; } @@ -390,6 +391,7 @@ private: RefPtr m_disallowed_cursor; RefPtr m_move_cursor; RefPtr m_drag_cursor; + RefPtr m_drag_copy_cursor; RefPtr m_wait_cursor; RefPtr m_crosshair_cursor; RefPtr m_eyedropper_cursor;