浏览代码

WindowServer+LibGUI: Add "wait" cursor

Linus Groh 5 年之前
父节点
当前提交
899dcba158

+ 1 - 0
Base/etc/WindowServer/WindowServer.ini

@@ -19,6 +19,7 @@ Move=/res/cursors/move.png
 Hand=/res/cursors/hand.png
 Hand=/res/cursors/hand.png
 Help=/res/cursors/help.png
 Help=/res/cursors/help.png
 Drag=/res/cursors/drag.png
 Drag=/res/cursors/drag.png
+Wait=/res/cursors/wait.png
 
 
 [Input]
 [Input]
 DoubleClickSpeed=250
 DoubleClickSpeed=250

二进制
Base/res/cursors/wait.png


+ 1 - 0
Libraries/LibGUI/Window.h

@@ -52,6 +52,7 @@ enum class StandardCursor {
     Help,
     Help,
     Drag,
     Drag,
     Move,
     Move,
+    Wait,
 };
 };
 
 
 class Window : public Core::Object {
 class Window : public Core::Object {

+ 2 - 0
Services/WindowServer/Cursor.cpp

@@ -78,6 +78,8 @@ RefPtr<Cursor> Cursor::create(StandardCursor standard_cursor)
         return WindowManager::the().drag_cursor();
         return WindowManager::the().drag_cursor();
     case StandardCursor::Move:
     case StandardCursor::Move:
         return WindowManager::the().move_cursor();
         return WindowManager::the().move_cursor();
+    case StandardCursor::Wait:
+        return WindowManager::the().wait_cursor();
     }
     }
     ASSERT_NOT_REACHED();
     ASSERT_NOT_REACHED();
 }
 }

+ 1 - 0
Services/WindowServer/Cursor.h

@@ -44,6 +44,7 @@ enum class StandardCursor {
     Help,
     Help,
     Drag,
     Drag,
     Move,
     Move,
+    Wait,
 };
 };
 
 
 class Cursor : public RefCounted<Cursor> {
 class Cursor : public RefCounted<Cursor> {

+ 1 - 0
Services/WindowServer/WindowManager.cpp

@@ -124,6 +124,7 @@ void WindowManager::reload_config(bool set_screen)
     m_disallowed_cursor = get_cursor("Disallowed");
     m_disallowed_cursor = get_cursor("Disallowed");
     m_move_cursor = get_cursor("Move");
     m_move_cursor = get_cursor("Move");
     m_drag_cursor = get_cursor("Drag");
     m_drag_cursor = get_cursor("Drag");
+    m_wait_cursor = get_cursor("Wait");
 }
 }
 
 
 const Gfx::Font& WindowManager::font() const
 const Gfx::Font& WindowManager::font() const

+ 2 - 0
Services/WindowServer/WindowManager.h

@@ -133,6 +133,7 @@ public:
     const Cursor& disallowed_cursor() const { return *m_disallowed_cursor; }
     const Cursor& disallowed_cursor() const { return *m_disallowed_cursor; }
     const Cursor& move_cursor() const { return *m_move_cursor; }
     const Cursor& move_cursor() const { return *m_move_cursor; }
     const Cursor& drag_cursor() const { return *m_drag_cursor; }
     const Cursor& drag_cursor() const { return *m_drag_cursor; }
+    const Cursor& wait_cursor() const { return *m_wait_cursor; }
 
 
     void invalidate(const Gfx::IntRect&);
     void invalidate(const Gfx::IntRect&);
     void invalidate();
     void invalidate();
@@ -216,6 +217,7 @@ private:
     RefPtr<Cursor> m_disallowed_cursor;
     RefPtr<Cursor> m_disallowed_cursor;
     RefPtr<Cursor> m_move_cursor;
     RefPtr<Cursor> m_move_cursor;
     RefPtr<Cursor> m_drag_cursor;
     RefPtr<Cursor> m_drag_cursor;
+    RefPtr<Cursor> m_wait_cursor;
 
 
     InlineLinkedList<Window> m_windows_in_order;
     InlineLinkedList<Window> m_windows_in_order;