mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 22:57:44 +00:00
WindowServer: Add a dedicated drag cursor
This commit is contained in:
parent
8423be2593
commit
39c2d04a9b
6 changed files with 10 additions and 0 deletions
|
@ -12,6 +12,7 @@ IBeam=/res/cursors/i-beam.png
|
|||
Disallowed=/res/cursors/disallowed.png
|
||||
Move=/res/cursors/move.png
|
||||
Hand=/res/cursors/hand.png
|
||||
Drag=/res/cursors/drag.png
|
||||
|
||||
[Colors]
|
||||
Background=50,50,50
|
||||
|
|
BIN
Base/res/cursors/drag.png
Normal file
BIN
Base/res/cursors/drag.png
Normal file
Binary file not shown.
After Width: | Height: | Size: 205 B |
|
@ -40,6 +40,8 @@ RefPtr<WSCursor> WSCursor::create(WSStandardCursor standard_cursor)
|
|||
return WSWindowManager::the().resize_diagonally_bltr_cursor();
|
||||
case WSStandardCursor::Hand:
|
||||
return WSWindowManager::the().hand_cursor();
|
||||
case WSStandardCursor::Drag:
|
||||
return WSWindowManager::the().drag_cursor();
|
||||
}
|
||||
ASSERT_NOT_REACHED();
|
||||
}
|
||||
|
|
|
@ -11,6 +11,7 @@ enum class WSStandardCursor {
|
|||
ResizeDiagonalTLBR,
|
||||
ResizeDiagonalBLTR,
|
||||
Hand,
|
||||
Drag,
|
||||
};
|
||||
|
||||
class WSCursor : public RefCounted<WSCursor> {
|
||||
|
|
|
@ -185,6 +185,7 @@ void WSWindowManager::reload_config(bool set_screen)
|
|||
m_i_beam_cursor = get_cursor("IBeam");
|
||||
m_disallowed_cursor = get_cursor("Disallowed");
|
||||
m_move_cursor = get_cursor("Move");
|
||||
m_drag_cursor = get_cursor("Drag");
|
||||
|
||||
m_background_color = m_wm_config->read_color_entry("Colors", "Background", Color::Red);
|
||||
|
||||
|
@ -1103,6 +1104,9 @@ void WSWindowManager::notify_client_changed_app_menubar(WSClientConnection& clie
|
|||
|
||||
const WSCursor& WSWindowManager::active_cursor() const
|
||||
{
|
||||
if (m_dnd_client)
|
||||
return *m_drag_cursor;
|
||||
|
||||
if (m_drag_window)
|
||||
return *m_move_cursor;
|
||||
|
||||
|
|
|
@ -103,6 +103,7 @@ public:
|
|||
const WSCursor& i_beam_cursor() const { return *m_i_beam_cursor; }
|
||||
const WSCursor& disallowed_cursor() const { return *m_disallowed_cursor; }
|
||||
const WSCursor& move_cursor() const { return *m_move_cursor; }
|
||||
const WSCursor& drag_cursor() const { return *m_drag_cursor; }
|
||||
|
||||
void invalidate(const WSWindow&);
|
||||
void invalidate(const WSWindow&, const Rect&);
|
||||
|
@ -196,6 +197,7 @@ private:
|
|||
RefPtr<WSCursor> m_i_beam_cursor;
|
||||
RefPtr<WSCursor> m_disallowed_cursor;
|
||||
RefPtr<WSCursor> m_move_cursor;
|
||||
RefPtr<WSCursor> m_drag_cursor;
|
||||
|
||||
Color m_background_color;
|
||||
Color m_active_window_border_color;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue