retext-project / retext

ReText: Simple but powerful editor for Markdown and reStructuredText
GNU General Public License v2.0
1.86k stars 198 forks source link

Link destination popup on hover #628

Closed donjan closed 5 months ago

donjan commented 1 year ago

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, nothing happens. The user must either click the link or copy the address and paste it, to know what the link points to.

Expected behaviour

A popup should appear, showing the destination URL.

Either in the bottom left, as with most web browsers:

Screenshot from 2023-07-17 18-23-00

Or floating near the link, as in LibreOffice Writer:

Screenshot from 2023-07-17 18-23-25

red-kite commented 1 year ago

Awesome :-) !! -- because I miss this feature for a long time! Few hours ago I spotted this issue and was hooked again!

https://github.com/red-kite/retext/commit/0c234efd3b7484102a959051b95ffc2ab78908b3

I'm on it (again -- years ago I tried hacking qt-stuff for exactly this reason but got tired and failed)

A bit more work is to be done before pull-request: As noted in the commit itself I want to drop the statusbar implementation and go with a 'custom Widget or so' resulting in a »bottom left, as with most web browsers«-solution which I want to upvote as this exactly killed me back then ^^

I aim for something like a small class urlPopup(QtWidgets.QWidget): […] but done for today… (hints, ideas welcome)

red-kite commented 12 months ago

This one works for me until a qt professional shows how to do it right :-) Show link target in lower left corner ✓ Compare with master: https://github.com/retext-project/retext/compare/master...red-kite:retext:showLinkOnHover

donjan commented 6 months ago

@red-kite thanks for implementing this! I've had it patched in for a while now, works perfectly. Would love to see this mainlined, any movement on your PR?

red-kite commented 6 months ago

Thank you @donjan for reminder and using/testing this piece so far. I have to admit that I got stuck on the remaining task of this PR: implementing the changes for dark-mode. (More on this in the PR's discussion)

mitya57 commented 5 months ago

Merged #634, so closing this issue. Thanks @red-kite!