Explorar o código

LibWeb: Set cursor on mousemove for non-text elements

Adam Plumb %!s(int64=3) %!d(string=hai) anos
pai
achega
7a035558e1
Modificáronse 1 ficheiros con 6 adicións e 0 borrados
  1. 6 0
      Userland/Libraries/LibWeb/Page/EventHandler.cpp

+ 6 - 0
Userland/Libraries/LibWeb/Page/EventHandler.cpp

@@ -352,6 +352,12 @@ bool EventHandler::handle_mousemove(const Gfx::IntPoint& position, unsigned butt
                     hovered_node_cursor = Gfx::StandardCursor::IBeam;
                 else
                     hovered_node_cursor = cursor_css_to_gfx(cursor);
+            } else if (node->is_element()) {
+                auto cursor = result.layout_node->computed_values().cursor();
+                if (cursor == CSS::Cursor::Auto)
+                    hovered_node_cursor = Gfx::StandardCursor::Arrow;
+                else
+                    hovered_node_cursor = cursor_css_to_gfx(cursor);
             }
 
             auto offset = compute_mouse_event_offset(position, *result.layout_node);