* Top menu & bottom menu tapzones are now full-width, thanks to the now sane override system.
* A separate, extra tapzone was also created for each of them to provide a taller, but narrower tapzone extension (one that doesn't clash with the prev/next tapzones).
* The footer tapzone was made much taller.
* Use a CRe set* method when toggling nightmode
This ensures it gets flagged as add_reset by the call cache, and that
CRe will actually re-render, as it's necessary if nightmode_images is
enabled (the default).
Fix#6845
* Prevent ReaderHighlight:onTap from running ReaderHighlight:clear when
it's unnecessary.
Avoiding a clearSelection call in CRe that could invalidate the cache
and cause unnecessary redraws.
* Don't store empty highlight arrays when all HLs on a page have
been deleted
This pull requests aims to provide convenient way to zoom in comics. The idea is when user holds/double taps (not decided yet) on a manga/comic panel, it gets cut out from the rest of the image and zoomed. More details in koreader/koreader-base#1148. Depends on koreader/koreader-base#1159
* Fix HW dithered partial refreshes sometimes behaving as if the refreshed
content had moved a few pixels to the side...
Probably a kernel issue with the alignment fixup in the EPDC?
* Get rid of the legacy coordinates fixup
It shouldn't be necessary anymore.
And I'd rather fix the root cause, anyway.
* Bump base
(https://github.com/koreader/koreader-base/pull/1116)
* Missed a few DIVs in #6224
Allows editing a CSS snippet to be applied to this
book only, without the need to create and edit
a User style tweak.
Allows copying any other tweak CSS by just taping
on it (and pasting into this with Hold).
Limit User style tweaks nb of items per menu page
to 6 (like we try to do for other tweaks menus).
Includes:
- GIF decoding: avoid crash on some images
- Top progress bar: avoid re-computing when not needed
- Top progress bar: allow external filling of marks
- CSS/Text: properly inherit and handle text-align-last
- getRenderedWidths(): fix handling of text-indent
- Reorder some flags to make the sets clearer
- CSS: support more white-space named values
- Text: fix standalone BR not making an empty line (rework)
- CSS: support for pseudo elements ::before & ::after
- CSS: content: open-quote support via TextLangMan
- CSS/Text selection: adds a few "-cr-hint:" tweaks
cre.cpp: adds setHeaderProgressMarks()
Added 2 style tweaks to disable pseudo elements
::before/after and common ligatures.
Also add "Dictionary" and "Fulltext search" to available
and cycleable highlight actions.
Generalize long-press (3s) at end of selection to show
the highlight dialog popup.
Includes:
- lvtinydom.cpp: fix Use-after-free
- lvtextfm: fix/cleanup lastnonspace code bits
- lvtextfm: fix vertical-align: top & bottom
- renderBlockElementEnhanced: minor fixes related to floats
- renderBlockElementEnhanced: compute baseline of block
- Add support for display: inline-block/inline-table
- Better selection highlighting by using getSegmentRects()
- getHtml(): add flag to get text soft-hyphenated
cre.cpp: toggable text selection highlighting method,
default to the new one using segments.
Update various cre flags to use the new features (and
to conform with some flags re-ordering):
- support display: inline-block in flat, book and web
render modes.
- get HTML with soft-hyphens for footnote popups, so MuPDF
can use them when rendering the footnote.
bidi.lua:
- Revert "Alias everything to Bidi.nowrap() when in LTR UI,
as using LTR isolates seems uneeded when already LTR" (part
of a628714f) which was a wrong assumption: we need proper
wrappers for all things paths. Enhance some of these wrappers.
- Fix GetText RTL wrapping which was losing empty lines and
trailing \n.
- Wrap all paths, directories, filenames in the code with
these wrappers.
- Wrap all book metadata (title, authors...) with BD.auto(),
as it helps fixing some edge cases (like open/close quotation
marks which are not considered as bracket types by FriBiDi).
(Needed some minor logic changes in CoverBrowser.)
- Tweak hyphenation menu text
- Update forgotten SortWidget for UI mirroring
- KoptConfig: update "justification" index for RTL re-ordering,
following the recent addition of the page_gap_height option.
Small tweaks all around to handle UI mirroring:
- swap existing symbols like arrows, or use alternative ones
- rotate some images, like chevrons and dogear icons
- flip some left and right swipe handling
- flip some geometry arithmetic like tap on left or right
side of page or dict window
- use new ProgressWidget:getPercentageFromPosition() instead
of geometry arithmetic
- BD.wrap() some concatenated string bits, like in reader
and menu footers
- flip inverse_reading_order when UI is mirrored
More specific tweaks:
- ReaderGesture: reset some specific gestures when UI direction
has changed (tap on top/bottom left/right corners, for
bookmarks and FileManager "Plus menu").
- ReaderRolling: show markers on the correct side of page,
in single or dual page mode.
- KoptOptions: swap left and right icons in Alignment toggle
- CheckMark: proper rendering in all 4 mirroring/rtl combinations.
- VirtualKeyboard: forbid any mirroring
- Move util.getMenuText into Menu.lua
Allow TextBoxWidget new text direction/lang parameters to be
set on upper widgets, and propagate them all the way to it
(ScrollTextWidget, InputText, InputDialog, TextViewer).
Use specific non-default ones in some specific cases:
- Force LTR text direction when showing HTML and CSS, and
configuration files (in some plugins).
- Use Wikipedia server language and text direction when
showing an article.
- Use auto with Dictionary results, as we don't know the
dictionary language, and they may contain mixed content.
- Force LTR when showing some paths (still needs more of them)
TextEditor plugin: add 2 new options "Auto paragraph direction"
and "Force paragraph direction LTR".
Footnotes popup: grab HTML direction, and forward it
to MuPDF for proper display.
This commit standardizes the various todos around the code a bit in a manner recognized by LDoc.
Besides drawing more attention by being displayed in the developer docs, they're also extractable with LDoc on the command line:
```sh
ldoc --tags todo,fixme *.lua
```
However, whether that particular usage offers any advantage over other search tools is questionable at best.
* and some random beautification
Bump crengine: background image and other fixes:
- View HTML: option to show text unicode codepoints
- Fix attribute parsing: decode &-encoded chars
- Text: allow wrap after more unicode spaces and hyphen
- Fix: no left hanging when hanging punctuation disabled
- lvtextfm.cpp: more comments, some formatting cleanup
- Optimize background image drawing
- CSS: fix background-image file path resolution
Bump luasec to 0.8.1
Bump harfbuzz to 2.6.0
cre.cpp:
Adds setBackgroundImage() proxy function to crengine
facility to set background textures (this is unrelated
to the background-image CSS fixes).
No frontend code (yet) to select such an image.
View HTML: adds a 3rd view (extended debug view), showing the
unicode codepoint of each char and crengine rendereing methods.
Similar to what's been added for 1 page view, but just turn
one page instead of switching to scroll mode when reaching
top left or bottom right corners.
Also make the selection start xpointer more accurate by
getting them in onHold(), instead of possibly too late in
onHoldPan() where we have already moved.
No need to use current page and xpointers. We can use
'pos', in both scroll and page modes, as it is always
accurate to show the y of the current view.
Also check for boxes in the 2nd page when in 2 page modes
(and fix onTapXPointerSavedHighlight(), too quickly cut
and pasted from drawXPointerSavedHighlight() recently).
Bump crengine and cre.cpp to correctly returns rect for
the first line of the 2nd page.
The idea of looking for highlights 1 page before and after
was not working when you have multiple small pages, and
some scroll mode view was actually showing 3 or 4 pages.
So, rework that by using absolute positions when looking
for highlights present in the scrolled view.
Panning to the bottom right corner (or top left corner) switches
to scroll mode and scroll the page forward (resp. backward) 1/3rd
of the screen.
One has to pan out of the corner to continue selection.
Panning again to that corner scrolls another 1/3rd of screen.
Page mode is restored when highlighting or dismissing the highlight
dialog, and a little marker is shown at where selection was started
so one does not get lost after all that scrolling and restoring.
Make this existing setting tunable with a menu item.
Also make the Page overlap and Highlight menus use a
checkbox, and their items grayed out when disabled.
Revert 9971eb85 and make multi-lines strings more readable.
(Multiline translatable strings extraction has been fixed
in koreader-misc tralua_xgettext.py.)