فهرست منبع

WindowServer: Show directional cursors when resizing windows.

Andreas Kling 6 سال پیش
والد
کامیت
c992534f73
2فایلهای تغییر یافته به همراه25 افزوده شده و 1 حذف شده
  1. 24 0
      Servers/WindowServer/WSWindowManager.cpp
  2. 1 1
      Servers/WindowServer/WSWindowManager.h

+ 24 - 0
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;
+}

+ 1 - 1
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: