Commit Graph

12 Commits

Author SHA1 Message Date
Eike Ziller
038e8491ee litehtml: Fix selection artifacts with scaled view
If you zoom into a page (Ctrl-+) and then select, artifacts could be
left behind when dragging or removing the selection again.
Fiddle around with coordinate transformations (with regard to rounding)
to fix that.

Change-Id: I68c29d8e3559b90dbb3b93550338e483d14731bf
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
2020-03-13 14:17:16 +00:00
Eike Ziller
123aa77c49 Help/litehtml: Guard against out-of-bounds scroll values
If we set the value of the scrollbar to an invalid value, nothing gets
repainted, so we need to take the branch that calls update explicitly in
that case.

Change-Id: I700c690119b1ee2fe8b88d77c29e00f329810448
Reviewed-by: hjk <hjk@qt.io>
2019-10-01 11:32:41 +00:00
Eike Ziller
2152d4750c Help/litehtml: Fix selection drawing for CMake documentation
Don't rely on litehtml calling draw_background for the root element.
Manually draw selections first, then let litehtml draw as before.

Change-Id: Ic9efd11b564dec1742aa6b6ffcb58133504681ff
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: Eike Ziller <eike.ziller@qt.io>
2019-09-26 09:31:20 +00:00
Eike Ziller
4610759aed Help/litehtml: Use antialiasing and higher-quality image resizing
Change-Id: Ib0e48130c94e2cfdc25560339376c0ed130c56fa
Reviewed-by: hjk <hjk@qt.io>
2019-09-24 12:11:58 +00:00
Eike Ziller
88d759d50f Help/litehtml: Keep top position also when zooming
Change-Id: I65e12d4fca33719bc1a3ae08f7871d08d8d9c449
Reviewed-by: hjk <hjk@qt.io>
2019-09-24 11:57:37 +00:00
Eike Ziller
f5e624feaa Help/litehtml: Keep top element visible when resizing
This implicitly fixes behavior of scrolling of context help when the
side-by-side help panel is not yet visible.

Task-number: QTCREATORBUG-4756
Change-Id: I28dd89b56fe7dfa2a3473f21740571c27a955e14
Reviewed-by: hjk <hjk@qt.io>
2019-09-20 12:57:08 +00:00
Eike Ziller
12ea33446d Help/litehtml: Support scaling
Scale the paint area for the HTML document

Change-Id: I75aa5f2bf057df7b2b160b2a005172ff88dbb2b7
Reviewed-by: hjk <hjk@qt.io>
2019-09-17 13:51:27 +00:00
Eike Ziller
dff7e1515a Help/litehtml: Implement text search
Build an index between (visible) text and litehtml elements, so we can
use the regular text search functionality of Qt.

Change-Id: I2bf29628482f81c67b20b9a02d7808a330a073eb
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2019-09-17 12:58:25 +00:00
Eike Ziller
f5d6eb564b Help: Fix font point sizes with litehtml
Change-Id: Ia2d7434ed965b00075747c0bdd43d90a236b99dd
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2019-09-13 06:48:02 +00:00
Eike Ziller
62d16e437a Help: Add context menu to litehtml backend
Change-Id: I051984e360b41d17d32cff80fd1d4017fc81dae6
Reviewed-by: hjk <hjk@qt.io>
2019-09-10 12:56:51 +00:00
Eike Ziller
4b8ec5ffb7 Help: Fix rendering images with litehtml
Creating the document parses it, which also populates the pixmap cache,
so we may not clear the pixmap cache afterwards.

Change-Id: I1e6d1669db898b1e50d59d135e52807afb307d09
Reviewed-by: Cristian Adam <cristian.adam@qt.io>
Reviewed-by: hjk <hjk@qt.io>
2019-09-02 15:18:15 +00:00
Eike Ziller
0efd65e07e Help: Add litehtml based viewer backend
For CMake add litehtml installation path to CMAKE_PREFIX_PATH
For qmake pass litehtml installation path via LITEHTML_INSTALL_DIR qmake
variable

Release build of litehtml is recommended.

The litehtml backend is used by default when available, you can force
QTextBrowser again with the environment variable
"QTC_HELPVIEWER_BACKEND=textbrowser".

Some things are not implemented yet:
- Text search
- Context menu
- Shift-drag to extend existing selection

Change-Id: I79f989e5fe2063de2e9832abbed19b24d7a1a1fe
Reviewed-by: hjk <hjk@qt.io>
2019-08-28 08:06:20 +00:00