Get rid of the weird interaction between device implementations,
`ffi.util` (`isSDL`, `noSDL`) and the device input code: each
device knows if it's using SDL or not, so rely on that to load
the right underlying input implementation.
(1) Followup to koreader/koreader-base#1921, #12503: when getting a pdf book id in the stats db, check for old records with null terminated authors and title.
Discussed in #11318. There are some other reasons for disappearing old stats for pdf (md5 changes when converting/writing to pdf or something else), hence not closing the issue.
(2) Add Dispatcher action for toggling statistics. Closes#11422.
Rename it to "Dimension units", and make it a radio submenu.
Migrate the previous metric_length setting to this new dimension_units
one.
Update optionsutil to follow it.
Don't mangle string input values when a unit was passed.
(i.e., keep displaying them as their actual string instead of as nil).
(e.g., when current is set to a number, but default is still unset,
which translates to "not set" in showValues).
Attempting to align the numbers on the same column was a fool's errand.
Our default UI font is not monospaced, to begin with,
and to do it right, we'd need to align the rightmost number, not the
leftmost ;).
i.e., T() would need to have much fancier justification capabilities ;).
Or, err, *any* text justification features, really ^^.
We want to be able to set a custom value (i.e., more_options),
because on high-dpi devices, the scaling can lead to pretty large
differences; but more_options on a toggle is ugly and clunky.
So, switch to something more suited to what this actually sets,
which is ultimately an absolute pixel value, like margins.
Add a few more steps on the low end to fill out the bar (and because
that's where I found them most useful on high-dpi devices).
The input value should go through Screen:scaleBySize(), as in onReadSettings
Otherwise, choosing an option from ConfigDialog leads to different
results than on document open, as one is scaled, but not the other.
Issue extant since the inception of page gap configuration,
way back in #5705
(The intended and correct behavior if of course to scale this, e.g., the
setting is a "koreader flex pixel", not an absolute actual px value ;).
configdialog doesn't actually pass a unit argument to
name_text_hold_callback, so pull it instead from a new name_text_unit
field.
Expand said helper to support a "px" unit, which simply converts from
our arbitrary pixels to actual on-device pixels (e.g., a plain
scaleBySize).
Enable real_size_string usage when name_text_true_values is set
(it's a NOP in terms of the generated string if no unit is specified).
Using `require` didn't make much sense since most of them are only used in a single place anyway, and it takes care of a few weird interactions in the process (besides not polluting `package.loaded` with useless crap ;)).
This pr removes the backup db (sync db) of the cloud syncing strategy when a different server location is used. This is to avoid the situation when later incoming db is not based on previously uploaded sync db.
Just warn about it in the logs.
This will only show up when opening the advanced settings UI, so we'll
keep it for now instead of *also* deleting the offending kv pair,
for the sake of not randomly destroying user content...
Namely, it trips a `recalculate` that snaps `visible_area` to `page_area` edges (depending on zoom/reading direction), while we do *NOT* actually want to move the view, just increase/decrease its height ;).
(This *might* happen more reliably than it used to since https://github.com/koreader/koreader/pull/11425 & https://github.com/koreader/koreader/pull/11557)
Also deal with scroll mode while I'm here, as recalculate doesn't affect scroll mode at all, since that uses an *array* of on-screen pages, each with their own visible_area, page_area & state.
Fix#12454