Days 33-35: Mouse functionality, and rewriting hints
Past Friday and on Monday I wasn't working on qutebrowser (apart from some usual maintaince tasks) as I was traveling to/from Evoke (which was great!). But there's a lot to write about from Wednesday, Thursday and today!
The first thing I got to work on Wednesday was the history - after moving the history implementation out of WebView, all it took was a single line (and a bugfix in that single line) to implement history for QtWebEngine.
After that I also split the history module into a QtWebKit specific and a generic file, to avoid importing QtWebKit if it's not needed.
I moved all mouse handling to an event filter so it was decoupled from any QtWebKit code and - in theory - would just work with QtWebEngine.
However, that took some more effort as QtWebEngine actually forwards all mouse events to a QOpenGLWidget (on which Chromium draws), and that also seems to be swapped out sometimes...
This initially just handled back/forward keys on mice which have them, but I then gradually moved over more mouse functionality:
- Mouse wheel zooming
- Open-target handling (ctrl-click / middle-click / also affects hints)
- Rocker gestures
- Insert mode on click (also affects hints)
Probably the most missed feature, and I made some important progress, though it's not quite there yet ;)
Last week, I moved some hinting code out of WebView, and today I did a complete rewrite of how hints are drawn.
In the new-hints branch, hints are now simply a QLabel shown on an overlay over the web contents instead of being a HTML element inserted into the page.
Apart from solving some issues like #925 where the hints are influenced by the page stylesheet, this makes the implementation much more straightforward and makes it work with the same code on both backends.
Initially, this looked quite wrong:
But after getting the sizing and more styling correct, they look better:
What's quite a challenge is that the old config used WebKit gradients (as the hint labels were actual page elements), so with the native drawing, the configuration is quite a bit different. The opacity is also part of the color, so I removed the hints -> opacity setting.
I tried to auto-migrate the trivial cases (like the default setting, or similar gradients), but for more complex existing settings qutebrowser will simply display an error and let the user fix it.
Contributions and maintainance
Contributions to qutebrowser are still on their all-time high!
In the past seven days, 20 pull requests got merged (and 6 new ones are still open), and there have been dozens - if not hundreds - of comments for issues and PRs. This is awesome, but of course also takes a bit of time ;)
I also helped tracking down a bug in pytest 3.0 (not released yet) affecting the qutebrowser testsuite. So far, nobody seems to know what's going on there exactly...
Other than that, a lot of other small things happened and a few bugs got fixed - too many to list them all here!