Quote:
Originally Posted by kovidgoyal
@jackie_w: So the situation with fullscreen images was interesting.
|
I'm glad you had fun.

Now back to not-so-much fun ... ScrambleEbook and QWebView vs QWebEngineView vs QTextBrowser
TL;DNR: Unless I'm missing something, for previewing the contents of an ebook, QTextBrowser is a poor substitute for QWebView/QWebEngineView due to its limited style support.
I realise this minor plugin is not going to be the tail that wags the calibre dog so I'm open to ideas if there's anything I can do to get the beta plugin QTextBrowser closer to how it looks in the QWebView of 3.47.1. Bear in mind I have limited Python skills (and none at all for Java, C++).
If what I've already done in the beta plugin is as good as it's going to get then I need to decide whether I'm going to discontinue the calibre plugin leaving only its standalone equivalent. It's fair to say there should be no detriment to the actual scrambled ebook output by the plugin, current vs. beta. However, whilst the look&feel of text in a widget may be cosmetic to some extent, I don't feel right releasing an update which is visually a fairly clunky downgrade.
----------------------------------------------------------------
More detail ...
I've attached some screenshots from ScrambleEbook current version vs. beta version. It has a calibre plugin and a standalone (kind of) version which uses a .bat file to run the .py file via calibre-debug.
Image 1: from current calibre plugin. Current standalone looks the same because both use QWebView.
Image 2: beta standalone using QWebEngineView
Image 3: beta calibre plugin using QTextBrowser
- Standalone. See image 1 vs. image 2
I found that my beta standalone can access QWebEngineView OK. The only minor difference between current and beta is I can't reproduce the beige background of the widget. I don't know why its .setStyleSheet() method doesn't produce the result I wanted, but I'll live with it.
- Calibre plugin. See image 1 vs. image 3
It was easy enough to change the QWebEngineView widget to QTextBrowser and to load a container HTML page into it using .setSource(QUrl.fromLocalFile(abs_path)).
I'm not sure whether the widget accesses the container CSS files referenced in the HTML <head> links or not. It may do because using the .setHtml() method to load content shows no styles/images at all. Whatever it is doing, the lack of style support is a real backward step compared to the webview widgets:- defaults to sans-serif body text and no paragraph indents
- no control of image size
- can't see images in <svg> tags at all, which often means the first thing you see, when requesting a Preview, is 2 blank widgets where the cover pages should be.
- embedded fonts not displayed.