for pdf/djvu files the crosshairs continues to work freely as before. This commit introduces primaraly the methods _getAdjacentLineWordRolling and _getAdjacentWordRolling which handle finding the next word vertically and horizontally respectviely. We now handle hyphenated words much more predictably in _isSplitHyphenatedWord as we no longer require using heuristics.
Also: minor revamp of the setting handling by having
onToggleFloatingPunctuation() accepting nil/true/false/0/1
and being the sole manager of self.floating_punctuation.
Fixes 2 cases where we could get stuck in an exepected state:
- if onHold would get us nothing to act on, we would stay stuck
in "hold" state (until a next hold) and taps for page turn
would not work
- if text selection would get us some text (ie. some punctuation)
that would be stripped to an empty string, we would just not
do the lookup, but the selection would stay: best to do that
lookup and get a "no result" window, that when closed would
do the normal cleanup.
Also increased the available range for the minimum width in the UI from 50% of the screen width to 90%, since with the fixed setting it could otherwise never get larger than 50%, but a wider size will be useful if only few and short items fill up less than 50% of the remaining space.
Fix annotation import to preserve notes, filter by type, deduplicate,
map drawer, and delete originals from PDF after import.
Closes#15075. Depends on koreader-base#2287.
* refactor onStopHighlightIndicator so it returns early
* stop text selection when opening menus or triggering hotkeys
* use self.ui.highlight (naturally)
* remove duplicated setDirty
We may happen to have an empty selection while panning,
no reason to abort the selection yet before release.
Also add get_segments=true to remaining calls to
getScreenBoxesFromPositions() that we forgot to
update to use it.
Replace the cumbersome implementation of language rotation
with a more natural language selection:
- replace the "en > fr" button with a "Language" button,
which on tap shows a popup with the user languages allowing
direct selection (instead of having to rotate through
all the intermediate languages and wait for each result)
- we don't touch anymore the user-set wikipedia_languages
array when switching language
- the newly selected language is stored in doc_settings, and
will be used for next queries on this book. It is also
stored in G_reader_settings as the language to be used
for next newly opened books and for lookups done when
in FileBrowser
Also:
On Wikipedia full articles, the top left hamburger menu
shows a popup with the other Wikipedia languages the
current article is available for, and allows reading
them.
Wikipedia article ToC: the 'sections' properties
of the Wikipedia API is now deprecated: use its
replacement 'tocdata'.
At reader startup, so the intended use case is correctly handled:
- an update is downloaded, and the user restarts KOReader
- the LuaJIT process returns control to the startup script which extracts the update
- the LuaJIT process is restarted, and if the startup script was changed, the user
is asked to quit and restart KOReader from the parent launcher