Bug 354785 - Adjust preview font size
Summary: Adjust preview font size
Status: RESOLVED FIXED
Alias: None
Product: KBibTeX
Classification: Applications
Component: User interface (show other bugs)
Version: 0.6
Platform: Other Linux
: NOR wishlist
Target Milestone: ---
Assignee: Thomas Fischer
URL:
Keywords:
Depends on:
Blocks:
 
Reported: 2015-11-03 11:11 UTC by Juergen Spitzmueller
Modified: 2015-11-10 10:18 UTC (History)
0 users

See Also:
Latest Commit:
Version Fixed In:


Attachments
Use QTextDocument and QTextEdit over WebEngine or WebKit for reference preview (2.74 KB, patch)
2015-11-04 21:05 UTC, Thomas Fischer
Details
Patch/attachment 95315 ported to KBibTeX 0.6 (5.09 KB, patch)
2015-11-05 20:12 UTC, Thomas Fischer
Details

Note You need to log in before you can comment on or make changes to this bug.
Description Juergen Spitzmueller 2015-11-03 11:11:53 UTC
It would be nice if the font size in the preview pane (particular the bibtex2html output) could be adjusted.
I have noted that it comes out quite differently on different monitors (and is particular small, close to unreadable, on HiDPI panels).

If it is also possible to adjust the font itself, this would be even better (or just use the system font instead of bibtex2html's default)
Comment 1 Thomas Fischer 2015-11-04 21:05:40 UTC
Created attachment 95315 [details]
Use QTextDocument and QTextEdit over WebEngine or WebKit for reference preview

This patch prefers using QTextDocument and QTextEdit over WebEngine or WebKit for reference preview.

Also, please provide the part of cmake's output where it tells you if it has found WebEngine or WebKit (plus 2-3 lines above and below).
Comment 2 Thomas Fischer 2015-11-04 21:13:40 UTC
I assume that you are using either Qt's WebEngine or WebKit component. In either components, font sizes are hard to control from the outside. This patches enforces the usage of "native" Qt components which more likely will follow the GUI's font settings.
Comment 3 Juergen Spitzmueller 2015-11-05 09:15:01 UTC
Alas, I cannot test your patch, since I am unable to build master due to some kde5 configuration issue i didn't manage to resolve. I am using branch 0.6.

This uses QtWebKit (without, it does not provide preview at all).
Comment 4 Juergen Spitzmueller 2015-11-05 14:03:52 UTC
OK, I managed to compile master now, and it looks much better indeed. However, I still don't see where the preview font size (alone) can be adjusted.

Nevertheless, setting version to 0.6. since this seems to affect qt4 significantly more.
Comment 5 Thomas Fischer 2015-11-05 20:12:57 UTC
Created attachment 95345 [details]
Patch/attachment 95315 [details] ported to KBibTeX 0.6

Please try this patch which applies to KBibTeX 0.6 (at least the branch from git: 'kbibtex/0.6').
Comment 6 Thomas Fischer 2015-11-05 20:20:49 UTC
(In reply to Juergen Spitzmueller from comment #4)
> OK, I managed to compile master now, and it looks much better indeed.
> However, I still don't see where the preview font size (alone) can be
> adjusted.
Well, it should not be necessary to be (manually) adjusted, it should use the default text size and font the KDE GUI is using everywhere else.

> Nevertheless, setting version to 0.6. since this seems to affect qt4
> significantly more.
Ok, I just added patch/attachment 95345 [details] for KBibTeX 0.6
Comment 7 Juergen Spitzmueller 2015-11-06 09:45:31 UTC
The patch works very well! It even gives the correct font size with HiDPI.

As to the manual adjustment: I had in mind the possibility to zoom the html output (e.g. via the context menu of the reference preview), and thus to make this larger than the default text size.

But the most severe usability problems are also solved by the latest patch.
Comment 8 Thomas Fischer 2015-11-08 19:42:20 UTC
Git commit 6723bd8e9406a6e7466f0b751b00b43502c8c91a by Thomas Fischer.
Committed on 08/11/2015 at 18:56.
Pushed by thomasfischer into branch 'kbibtex/0.6'.

Use only QTextDocument/QTextEdit for reference preview

The reference preview uses a HTML rendering engine to show
references in a pretty fashion. So far, either a WebKit,
a WebEngine, a QLabel, or a QTextDocument/QTextEdit-based
solution (depending on version, platform, and availability)
has been used.

To simplify the code and in order to make rendered HTML
output to use the same font size as the regular user
interface, QTextDocument/QTextEdit will be used
exclusively to preview references.

M  +22   -45   src/program/docklets/referencepreview.cpp
M  +1    -1    src/program/docklets/referencepreview.h

http://commits.kde.org/kbibtex/6723bd8e9406a6e7466f0b751b00b43502c8c91a
Comment 9 Thomas Fischer 2015-11-10 10:18:18 UTC
> As to the manual adjustment: I had in mind the possibility to zoom the html
> output (e.g. via the context menu of the reference preview), and thus to
> make this larger than the default text size.
There is no quick and easy way to implement this feature. I'll try to keep it in my metal todo list, though.