Adds in-definition search to DictQuickLookup relaying on MuPDF's word-matching implementation, uses tap handling for navigation by allowing temporary disable/restore of Tap events.
Due to the way this was wired, #14937 trigged BookStatusWidget:onSwitchFocus() when closing, which caused the review input dialog to pop right back up again.
But it doesn't look like you're actually supposed to be able to type in there at all, so I replaced it with a TextBoxWidget.
* refactor handling of faked event HoldRelease for text selection on NT, make sure we close the cycle properly so we don't get any byte drift when dealing with non-ascii characters.
* Removed the hold-duration logic for switching between dictionary and wiki lookups, simplifying the process and removing timing-based domain switching, this was a terrible idea on my part (in hindsight, the implementation I mean).
* Added a new `TextSelectorModifierPress` key event and corresponding handler (`onTextSelectorModifierPress`) to explicitly switch domains (Dict <-> Wiki) during text selection, and for following links inside dictionary entries, thus making the feature more discoverable and reliable.
* Refactored the lookup logic into a dedicated `_performLookupOnSelection` function, improving code clarity.
* Updated the gesture coordinate calculation in `_createTextSelectionGesture` to use `text_widget` absolute position instead of `definition_widget`, ensuring correct screen coordinates and accounting for container padding.
Previously, on SDL targets (Desktop, Ubuntu Touch), the system text input loop was gated by the visibility of the On-Screen Virtual Keyboard. Hiding the VK would call Device:stopTextInput, effectively disabling the physical keyboard.
This commit binds the text input state to the lifecycle of the InputText widget instead:
* Improve up/down behavior. Down at the end of an input moves focus down, up at the beginning moves focus up.
* Undo removal of key_event for touch devices, allowing vk to work regardless of vk state, #FreeTheKeyboard
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'.
Could cause some refreshes (actually triggered when
the scrollbar changes) in DictQuickLookup to be ignored
in some rare circonstances (2 consecutive results from
a text dictionary having the exact same nb of lines).