1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-25 19:07:35 +00:00

LibGUI+WindowServer: Add a "Hand" cursor to the standard cursors

This commit is contained in:
Andreas Kling 2019-10-10 21:35:12 +02:00
parent a6e4c504e2
commit 76266862d1
7 changed files with 8 additions and 0 deletions

View file

@ -11,6 +11,7 @@ ResizeDBLTR=/res/cursors/resize-diagonal-bltr.png
IBeam=/res/cursors/i-beam.png IBeam=/res/cursors/i-beam.png
Disallowed=/res/cursors/disallowed.png Disallowed=/res/cursors/disallowed.png
Move=/res/cursors/move.png Move=/res/cursors/move.png
Hand=/res/cursors/hand.png
[Colors] [Colors]
Background=50,50,50 Background=50,50,50

BIN
Base/res/cursors/hand.png Normal file

Binary file not shown.

After

Width:  |  Height:  |  Size: 241 B

View file

@ -19,6 +19,7 @@ enum class GStandardCursor {
ResizeVertical, ResizeVertical,
ResizeDiagonalTLBR, ResizeDiagonalTLBR,
ResizeDiagonalBLTR, ResizeDiagonalBLTR,
Hand,
}; };
class GWindow : public CObject { class GWindow : public CObject {

View file

@ -38,6 +38,8 @@ RefPtr<WSCursor> WSCursor::create(WSStandardCursor standard_cursor)
return WSWindowManager::the().resize_diagonally_tlbr_cursor(); return WSWindowManager::the().resize_diagonally_tlbr_cursor();
case WSStandardCursor::ResizeDiagonalBLTR: case WSStandardCursor::ResizeDiagonalBLTR:
return WSWindowManager::the().resize_diagonally_bltr_cursor(); return WSWindowManager::the().resize_diagonally_bltr_cursor();
case WSStandardCursor::Hand:
return WSWindowManager::the().hand_cursor();
} }
ASSERT_NOT_REACHED(); ASSERT_NOT_REACHED();
} }

View file

@ -10,6 +10,7 @@ enum class WSStandardCursor {
ResizeVertical, ResizeVertical,
ResizeDiagonalTLBR, ResizeDiagonalTLBR,
ResizeDiagonalBLTR, ResizeDiagonalBLTR,
Hand,
}; };
class WSCursor : public RefCounted<WSCursor> { class WSCursor : public RefCounted<WSCursor> {

View file

@ -143,6 +143,7 @@ void WSWindowManager::reload_config(bool set_screen)
m_wm_config->read_num_entry("Screen", "Height", 1080)); m_wm_config->read_num_entry("Screen", "Height", 1080));
m_arrow_cursor = get_cursor("Arrow", { 2, 2 }); 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_horizontally_cursor = get_cursor("ResizeH");
m_resize_vertically_cursor = get_cursor("ResizeV"); m_resize_vertically_cursor = get_cursor("ResizeV");
m_resize_diagonally_tlbr_cursor = get_cursor("ResizeDTLBR"); m_resize_diagonally_tlbr_cursor = get_cursor("ResizeDTLBR");

View file

@ -90,6 +90,7 @@ public:
const WSCursor& active_cursor() const; const WSCursor& active_cursor() const;
const WSCursor& arrow_cursor() const { return *m_arrow_cursor; } 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_horizontally_cursor() const { return *m_resize_horizontally_cursor; }
const WSCursor& resize_vertically_cursor() const { return *m_resize_vertically_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; } const WSCursor& resize_diagonally_tlbr_cursor() const { return *m_resize_diagonally_tlbr_cursor; }
@ -180,6 +181,7 @@ private:
void pick_new_active_window(); void pick_new_active_window();
RefPtr<WSCursor> m_arrow_cursor; RefPtr<WSCursor> m_arrow_cursor;
RefPtr<WSCursor> m_hand_cursor;
RefPtr<WSCursor> m_resize_horizontally_cursor; RefPtr<WSCursor> m_resize_horizontally_cursor;
RefPtr<WSCursor> m_resize_vertically_cursor; RefPtr<WSCursor> m_resize_vertically_cursor;
RefPtr<WSCursor> m_resize_diagonally_tlbr_cursor; RefPtr<WSCursor> m_resize_diagonally_tlbr_cursor;