Don't cleanup input text as much when entered manually
(or when it's sane) than when coming from book text
selection.
This may allow looking up words like "-suffix", or
do more precise Wikipedia queries.
Brainfart from 6162c287e8
Forgot to zap the original UIManager:show(), so we were stacking two
identical widgets on top of each other, which obviously affected alpha.
Re #7029
- Rework widget layout to avoid implicit (and wrong)
sizing, using proper padding/margins and correct
measurements of components.
- Adjust lookup word font size so it's not smaller
than the definition.
- Tweak small window positionning: keep it centered
if possible, only move it to keep the highlighted
word shown when we can.
- Large window: adjust to screen size correctly,
leaving room for footer.
- Always have a "Close" button at bottom right.
Former always displayed button "Follow link" will
be added as a 3rd row in the rare case we select
a word in a link.
- Replace "tap on lookup word to edit and redo the
query" with an icon on the right: tap on it to
edit the queries word, long-press to edit the
current result word. Only close the current dict
window when lookup is launched.
- Remove feature "tap on title to set current dict
as the default dict for this document", as it didn't
really work, and it was bad UX.
If interrupted quickly just after lookup launch, don't
display anything (this might help avoiding refreshes
and the need to dismiss after accidental long-press
when manipulating the device).
- InfoMessage: add an option show_delay.
- MovableContainer: avoid possible crash when
not yet painted.
- ReaderDictionary: use show_delay=0.5 instead of
scheduleIn(0.5n...) (a5b133da) as we need the
InfoWidget to be known to UIManager to catch tap
and allow interrupting lookups properly.
- ReaderDictionary: rework handling of no_refresh_on_close
(6162c287) with proper regions comparisons
Drop the use of crengine's getWordFromPosition() which
is a bit unreliable: it may returns wrong coordinates,
or words from far away in the book (ie. when holding
in the margins).
Rely only on the robust getTextFromPositions() that
we already use for multi words selection.
Having good coordinates allows refreshing a smaller region
(the higlighted word, or the 2 lines if hyphenated).
* Modernize jit syntax
It's built-in, no need for a require anymore.
* Flag Android should_restrict_JIT again
It's mildly helpful at putting off the inevitable.
(very, very, very, very mildly).
* Bump android-luajit-launcher
https://github.com/koreader/android-luajit-launcher/pull/281
That way images can be made to work in a more generic, portable manner, such as:
```
return function(html, dict_path)
html = html:gsub('<rref[^>]*>([^<]*%.jpg)</rref>', '<img src="'..dict_path..'res/%1">')
return html
end
```
Cf. <https://github.com/koreader/koreader/issues/6056>.
* Don't paint invisible background-colored rounded corners
Made obvious when testing #7042
* Only enforce a highlight radius on buttons that don't already set a
custom one ;).
(Mostly, square buttons with a 0 radius ^^).
ffi/blitbuffer already handles radius being nil, which suits us just fine
:)
* Implement proper alpha-blending of SVG icons
Also, instead of doing that every time, cache a pre-composited version
that matches the screen's BB type.
This is faster, and also has the advantage of making icon highlights
behave.
Jot down a few notes about corner-cases or future improvements, e.g.,
dimming icons on non-white backgrounds, and nightmode with color icons.
- Add IconWidget, use it for icons instead of ImageWidget.
Specify icons by name only, look for them (with either
.svg or .png suffixes) in multiple directories (including
koreader/settings/icons/ to allow customizing them).
Don't crash when icon name not found, shown a black
background warning icon instead.
- Don't trust the icons' native sizes: replace
scale_for_dpi=true with width/height=DGENERIC_ICON_SIZE,
so all icons get the same (tunable) size - except in
a few specific use cases.
- Top and bottom menu bars: normalize, and have icons
properly centered in them, extend vertical line
separators up to the edges.
- TOC: adjust expand/collapse icons size to items size
* Avoid the Lua string copies when compressing/uncompressing the bb
thumbs
* Delay the statement reset so that the pointer returned by the BLOB
query is actually usable ;).
* Re-use a ZSTD decompression context
* Store date & mtime for successfully extracted documents
c.f., 10477501f9 (r44914917)
* Switch to user_version pragma to handle DB schema versioning
* Update file size/date on *each* extraction attempt.
@poirez-z raised a good point, this ought to be useful to deem a file
re-parseable after an update.
* Remove xutil
Functionality has been moved to ffi/zlib & ffi/zstd
* Preserve settings when migrating the BookInfo DB
* Warn via InfoMessage that the DB was updated
* Only store the series name in series, and move the index in series_index
(Column names chosen to match Calibre's).
* Handle the new series_index column in BookInfo consumers
* This allows us to get rid of the code that stripped empty decimals
from series index in *most* places, since it's now a real Lua
number, and the string formatting library does that magic on its
own.
* stride is now a size_t
On some platforms, that's 64 bits, which means it's no longer
automatically converted to a Lua number to avoid precision loss.
Do that ourselves, because lua-serialize doesn't know how to handle an
uint64_t cdata ;).