Ladybird: Add basic cursor shape support in WebView

This commit is contained in:
Thitat Auareesuksakul 2022-07-06 16:37:29 +07:00 committed by Andrew Kaster
parent a7cb558783
commit ec44691b56
Notes: sideshowbarker 2024-07-18 00:34:07 +09:00

View file

@ -42,6 +42,7 @@
#include <LibWebSocket/ConnectionInfo.h>
#include <LibWebSocket/Message.h>
#include <LibWebSocket/WebSocket.h>
#include <QCursor>
#include <QIcon>
#include <QMouseEvent>
#include <QPaintEvent>
@ -158,8 +159,20 @@ public:
{
}
virtual void page_did_request_cursor_change(Gfx::StandardCursor) override
virtual void page_did_request_cursor_change(Gfx::StandardCursor cursor) override
{
switch (cursor) {
case Gfx::StandardCursor::Hand:
m_view.setCursor(Qt::PointingHandCursor);
break;
case Gfx::StandardCursor::IBeam:
m_view.setCursor(Qt::IBeamCursor);
break;
case Gfx::StandardCursor::Arrow:
default:
m_view.setCursor(Qt::ArrowCursor);
break;
}
}
virtual void page_did_request_context_menu(Gfx::IntPoint const&) override