Commit Graph

10716 Commits

Author SHA1 Message Date
NiLuJe cd0d8ca8bd UI: Support appending the value in pixels when formating metric/imperial dimensions 2024-09-16 17:12:43 +02:00
NiLuJe f8890a310d optionsutil: Rename real_size_string to formatFlexSize, and make it public
Use it in the ReaderView:onPageGapUpdate notification, instead of
enforcing "px" there.
2024-09-16 17:12:43 +02:00
NiLuJe d537ef5c76 UI: Expand the "Units" configuration menu to include "Pixels"
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.
2024-09-16 17:12:43 +02:00
NiLuJe 77b6ef785a koptoptions: Stop making page gap a special snowflake
Use the user-preferred display unit for dimensions.
2024-09-16 17:12:43 +02:00
NiLuJe 7239cf391d optiuonsutil: unbreak real_size_string
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).
2024-09-16 17:12:43 +02:00
NiLuJe 9333843919 optionsutil: tweak showValuesHMargins text string
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 ^^.
2024-09-16 17:12:43 +02:00
NiLuJe da2957392a optionsutil: Refactor size conversion/printing
DRYer, simpler. Will make it easier to make "px" a real viable display
format.
2024-09-16 17:12:43 +02:00
NiLuJe 65ce72df27 KOptOptions: Make Page Gap a buttonprogress instead of a toggle
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).
2024-09-16 17:12:43 +02:00
NiLuJe af51bfafad ReaderView: Fix onPageGapUpdate
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 ;).
2024-09-16 17:12:43 +02:00
NiLuJe a55b1038d7 optionsutil: Make sure showValues can actually use the real_size_string helper effectively
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).
2024-09-16 17:12:43 +02:00
NiLuJe da74691515 Chore: Don't cache static data tables (ui/elements, ui/data, kb layouts & co) (#12519)
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 ;)).
2024-09-16 17:11:42 +02:00
NiLuJe aa6cadb1ee SyncService: Only require online connectivity when using Dropbox (#12520)
Aligns with the CloudStorage behavior.

Fix #12518
2024-09-16 17:10:45 +02:00
hius07 bf290e0c2b Write highlights into PDF: revisited (#12509) 2024-09-14 15:21:26 +03:00
weijiuqiao 33525a80a0 VocabBuilder.koplugin: better handling of word context (#12469)
Closes #12465.
2024-09-14 14:09:49 +02:00
weijiuqiao 04aa0cbde3 CloudSync: handles potentially incompatible backup and incoming dbs (#12470)
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.
2024-09-14 14:08:03 +02:00
hius07 d3beecd3f5 ReaderAnnotation: skip old highlights with invalid xpointers (#12494) 2024-09-14 11:17:26 +03:00
NiLuJe 57ceaf3f07 SetDefaultsWidget: Don't crash on unknown custom keys
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...
2024-09-11 13:20:39 +02:00
NiLuJe 89cceee9f1 Defaults: Deprecate DKOPTREADER_CONFIG_DOC_LANGS_TEXT
It's unused since #11977, dropping it ensures we no longer show it in
the advanced settings UI.
2024-09-11 13:20:39 +02:00
Benoit Pierre 7ff40a3412 bump base (#12503)
- https://github.com/koreader/koreader-base/pull/1921
- https://github.com/koreader/koreader-base/pull/1922
- https://github.com/koreader/koreader-base/pull/1923
- https://github.com/koreader/koreader-base/pull/1924
- https://github.com/koreader/koreader-base/pull/1926
- https://github.com/koreader/koreader-base/pull/1927
- https://github.com/koreader/koreader-base/pull/1928
- https://github.com/koreader/koreader-base/pull/1930
- https://github.com/koreader/koreader-base/pull/1931

Close #12462, #12473.
2024-09-10 18:36:08 +02:00
cccslater 94c57b9f42 [NT] Call GotoViewRel for page up/down on useDPadAsActionKeys devices (#12495)
Page buttons call `GotoViewRel` again (not `GotoPosRel`). Fixes https://github.com/koreader/koreader/issues/12380
2024-09-09 21:17:48 +02:00
David 5b2cc5f632 Doc: Update quickstartguide on kindle non touch (#12426) 2024-09-09 14:40:17 +02:00
David adbf3be6ec [Dispatcher] new events for selecting links (#12474) 2024-09-07 20:53:14 +02:00
hius07 5476301034 ButtonDialogTitle: remove (#12394) 2024-09-07 20:11:35 +03:00
hius07 7572a812cc Highlights popup dialog: add "Color" and "Details" buttons (#12461) 2024-09-07 17:56:40 +03:00
NiLuJe ffc4929504 ReaderHighlight: Fix an old typo in the OCR help string (#12479)
Noticed while triaging #12478 ;)
2024-09-07 16:23:56 +02:00
NiLuJe f8df76e5c4 misc: Move cleanupSelectedText to util (#12477)
Instead of duplicating it across ReaderHighlight, languagesupport, and potentially VocabBuilder.

Re: #12469
2024-09-06 23:06:28 +02:00
NiLuJe 8f5215abfd ReaderView: Fix a couple of edge-cases in onReaderFooterVisibilityChange (#12466)
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
2024-09-06 15:28:35 +02:00
David 802a906870 [Dispatcher] add [missing] conditions to dispatcher items (#12453)
* add [missing] conditions to dispatcher items

* add book map to NT supported devices
2024-09-05 20:07:35 +02:00
Ichnilatis 00984ba6bc Keyboard: update el_popup.lua (#12463)
Some minor changes for consistency.
2024-09-04 15:31:30 +02:00
NiLuJe ae5222b97a InputText: Unbreak onTapTextBox on an already in-focus field (#12449)
The drive-by fix for the original issue noticed late in #12361 turned out to be a bit heavy-handed ;).

Fix #12444
Regression since #12361
2024-09-02 23:38:57 +02:00
poire-z 824bb98407 bump base: blitbuffer, android build, crengine (#12451)
Includes:
- BlitBuffer: Don't crash on nil input in colorFromName
- android: fix 32bits builds
- android: don't bother linking with `origin.ldflags`
- android: don't version shared objects
- cre.cpp: fix findAllText() context at end of book
- bump crengine: fix xml parser regression (infinite loop)
2024-09-02 23:03:35 +02:00
bitterlox 491e24ea25 Fix Joplin export (#12446)
turn highlight & notes table into string before sending to joplin
2024-09-02 10:53:07 +02:00
jonnyl2 2a9fe6fdcf Dispatcher/DeviceListener: temporarily turn on Accelerometer/GSensor for 5 sec (#12419) 2024-09-01 23:53:51 +02:00
mbays d097dc0f8c Terminal: Add newline when wrapping
Required to maintain "tty-matrix".
2024-08-31 23:38:37 +02:00
mbays c2dbd7bf88 Terminal: Don't refresh while input widget closed
Fixes crash on e.g. closing widget after "sleep 3 && echo -e '\eY11'"
2024-08-31 23:38:37 +02:00
mbays 2a39bd15b3 Terminal: Add FIXMEs 2024-08-31 23:38:37 +02:00
mbays f6ee0aed4f Terminal: Ignore rightChar at end of line 2024-08-31 23:38:37 +02:00
mbays 40034743ad Terminal: Fix handling of '\b' 2024-08-31 23:38:37 +02:00
mbays f86482c210 Terminal: Remove unnecessary expensive textbox re-inits 2024-08-31 23:38:37 +02:00
mbays ffd75eb8f1 Terminal: Remove delay on enter 2024-08-31 23:38:37 +02:00
mbays 381a87f9f3 Terminal: Refactor to reduce algorithmic complexity 2024-08-31 23:38:37 +02:00
mbays 1ae38ea8bd Terminal: Ignore ctrl on chars less than '@'
Previous behaviour was to crash.
2024-08-31 23:38:37 +02:00
NiLuJe cf83dc8bd3 ReaderView: Don't crash on pre-#11044 highlights without a color field (#12438)
(They'll be drawn in gray, as before)

Regression since #11044
(https://github.com/koreader/koreader/pull/11044#issuecomment-2322820971)
2024-08-31 22:55:59 +02:00
hius07 49e885321a Exporter: choose highlight styles to be exported (#12431) 2024-08-31 19:28:48 +03:00
hius07 38c8d66b5b readerhighlight: fix showing anchored popup dialog 2024-08-31 15:18:18 +02:00
hius07 6f7277d269 readersearch: fix building findall result 2024-08-31 15:18:18 +02:00
hius07 963aa9ac7c filemanagerhistory: fix update list after deleting a file 2024-08-31 15:18:18 +02:00
hius07 ee5a4169d1 webdavapi: fix 'resourcetype' property check 2024-08-31 15:18:18 +02:00
hius07 84ed68ba82 inputtext: fix deleting a word by backspace swipe north 2024-08-31 15:18:18 +02:00
Rowan Decker 60e0e3ef45 Add color highlight menu (#11044) 2024-08-30 22:10:43 +02:00