Closed donjan closed 5 months ago
This could be done in webenginepreview.py
by adding QCursor
to the from PyQt6.QtGui import
line and defining the two cursors:
hand_cursor = QCursor(Qt.CursorShape.PointingHandCursor)
arrow_cursor = QCursor(Qt.CursorShape.ArrowCursor)
Then in webenginepreview.py::ReTextWebEnginePreview
, once we have the webPage
object, hook into it with
webPage.linkHovered.connect(lambda value: self.setCursor(hand_cursor if value else arrow_cursor))
Works for me:
MR upcoming, I'll try to use camel case.
Using ReText 8.0.1 on Ubuntu 22.04.
Enabled the WebEngine renderer option (had to
pip install PyQt6-WebEngine
). With live preview on.Observed behaviour
When hovering over a link, the mouse cursor stays arrow shaped.
Expected behaviour
The mouse cursor should change into a hand with pointed index finger, as it does in ReText 7.x and in web browsers.