diff options
author | Andreas Kling <awesomekling@gmail.com> | 2019-03-31 22:27:37 +0200 |
---|---|---|
committer | Andreas Kling <awesomekling@gmail.com> | 2019-03-31 22:27:37 +0200 |
commit | c992534f73944bb562ad463752596f408ad44866 (patch) | |
tree | 13d8d2bead8921f2f9fff5774c4e64cd605dc1b1 /Servers | |
parent | 90b2723e7a5b84dc3be7d059c95aaea1c176d3ce (diff) | |
download | serenity-c992534f73944bb562ad463752596f408ad44866.zip |
WindowServer: Show directional cursors when resizing windows.
Diffstat (limited to 'Servers')
-rw-r--r-- | Servers/WindowServer/WSWindowManager.cpp | 24 | ||||
-rw-r--r-- | Servers/WindowServer/WSWindowManager.h | 2 |
2 files changed, 25 insertions, 1 deletions
diff --git a/Servers/WindowServer/WSWindowManager.cpp b/Servers/WindowServer/WSWindowManager.cpp index 23a8503115..5c13d7223c 100644 --- a/Servers/WindowServer/WSWindowManager.cpp +++ b/Servers/WindowServer/WSWindowManager.cpp @@ -1275,3 +1275,27 @@ void WSWindowManager::notify_client_changed_app_menubar(WSClientConnection& clie set_current_menubar(client.app_menubar()); invalidate(menubar_rect()); } + +const WSCursor& WSWindowManager::active_cursor() const +{ + if (m_resize_window) { + switch (m_resize_direction) { + case ResizeDirection::Up: + case ResizeDirection::Down: + return *m_resize_vertically_cursor; + case ResizeDirection::Left: + case ResizeDirection::Right: + return *m_resize_horizontally_cursor; + case ResizeDirection::UpLeft: + case ResizeDirection::DownRight: + return *m_resize_diagonally_tlbr_cursor; + case ResizeDirection::UpRight: + case ResizeDirection::DownLeft: + return *m_resize_diagonally_bltr_cursor; + case ResizeDirection::None: + ASSERT_NOT_REACHED(); + } + } + + return *m_arrow_cursor; +} diff --git a/Servers/WindowServer/WSWindowManager.h b/Servers/WindowServer/WSWindowManager.h index 751ad94f44..e062d658cb 100644 --- a/Servers/WindowServer/WSWindowManager.h +++ b/Servers/WindowServer/WSWindowManager.h @@ -84,7 +84,7 @@ public: bool set_wallpaper(const String& path); String wallpaper_path() const { return m_wallpaper_path; } - const WSCursor& active_cursor() const { return *m_arrow_cursor; } + const WSCursor& active_cursor() const; Rect current_cursor_rect() const; private: |