Commit Graph

1620 Commits

Author SHA1 Message Date
Frans de Jonge
12b075a4ac [minor] normalize a few requires (#13055)
Some checks are pending
macos / macOS ${{ matrix.image }} ${{ matrix.platform }} 🔨${{ matrix.xcode_version }} 🎯${{ matrix.deployment_target }} (10.15, 13, x86-64, 15.2) (push) Waiting to run
macos / macOS ${{ matrix.image }} ${{ matrix.platform }} 🔨${{ matrix.xcode_version }} 🎯${{ matrix.deployment_target }} (11.0, 14, ARM64, 15.4) (push) Waiting to run
2025-01-13 08:33:18 +01:00
TnS-hun
bf35875ba3 Dictionary, footnotes: highlight the selected text (#12948)
When selecting text in the dictionary (including Wikipedia) or the pop-up footnotes highlight the selected text using an inverting rectangle. After closing the opened dictionary remove the highlight after a short delay just like in the reader.

Depends on koreader/koreader-base#2013
2025-01-12 14:46:45 +01:00
hius07
5cd9494ae9 Annotations: fix matchFunc (#13037)
Some checks failed
macos / macOS ${{ matrix.image }} ${{ matrix.platform }} 🔨${{ matrix.xcode_version }} 🎯${{ matrix.deployment_target }} (10.15, 13, x86-64, 15.2) (push) Has been cancelled
macos / macOS ${{ matrix.image }} ${{ matrix.platform }} 🔨${{ matrix.xcode_version }} 🎯${{ matrix.deployment_target }} (11.0, 14, ARM64, 15.4) (push) Has been cancelled
Compare only datetime and start/end positions, it's enough.
Closes #13030.
2025-01-10 08:48:25 +01:00
hius07
04c0ee5f04 readerannotation: datetime_updated (#12963)
Some checks are pending
macos / macOS ${{ matrix.image }} ${{ matrix.platform }} 🔨${{ matrix.xcode_version }} 🎯${{ matrix.deployment_target }} (10.15, 13, x86-64, 15.2) (push) Waiting to run
macos / macOS ${{ matrix.image }} ${{ matrix.platform }} 🔨${{ matrix.xcode_version }} 🎯${{ matrix.deployment_target }} (11.0, 14, ARM64, 15.4) (push) Waiting to run
2024-12-31 08:54:29 +02:00
hius07
e6b45e7ff7 ReaderSearch results: search string always in bold (#12940) 2024-12-27 08:27:13 +02:00
hius07
15f5dbef83 Reader: inspect zip file content to choose provider (#12902) 2024-12-19 09:41:19 +02:00
David
8f1461316c [HotKeys] Add a 'type to search' setting to hasKeyboard devices (#12860) 2024-12-12 22:23:49 +01:00
TnS-hun
f232b0e8e6 Dictionary: fix missing images (#12877)
Pass the dictionary's res directory to Mupdf.openDocumentFromText to allow MuPDF to display images referenced by HTML dictionaries.

Depends on: https://github.com/koreader/koreader-base/pull/2002
Fixes: https://github.com/koreader/koreader/issues/12628
2024-12-12 21:58:35 +01:00
hius07
7444ec53e9 Remove onSetFullScreen() (#12871) 2024-12-09 12:33:16 +02:00
hius07
0386e2619e Patch management: plugin -> core (#12862) 2024-12-08 09:33:46 +02:00
hius07
ea46d71634 Highlights: anchored dialogs (#12810) 2024-12-05 18:53:59 +02:00
hius07
47feaaa1df Highlights: page boxes cache (#12768) 2024-11-23 14:05:05 +02:00
hius07
93f2fa6702 Highlight: line height (#12721) 2024-11-21 07:54:23 +02:00
jonnyl2
fa20344a15 ReaderHighlight: Highlight menu, change 'Delete' to Trash can icon (#12758)
Closes #12754; as discussed there.
2024-11-20 20:31:20 +01:00
Frans de Jonge
11981821f6 [minor] ReaderHighlight: normalize more spelling of PDF (#12732) 2024-11-12 21:06:31 +01:00
Frans de Jonge
d3893b6cf1 [minor] ReaderHighlight: normalize spelling of PDF (#12731) 2024-11-12 21:05:16 +01:00
hius07
97a7ebefb9 Text editor: rotate (#12658) 2024-10-29 20:49:43 +02:00
mergen3107
f8446538c0 Fix KOReader spelling in the code (#12670) 2024-10-24 10:46:46 +02:00
hius07
54e33d27ea ReaderHighlight: fix color for extended highlight in pdf (#12654)
Closes #12653.
2024-10-18 20:59:31 +02:00
jonnyl2
a4dcfd2d52 ReaderFont: fix "new" fonts in generated font test document (#12646)
New fonts were not rendering in their own font because
the font names were modified directly in the face_list table.
2024-10-18 16:46:57 +02:00
hius07
f143f5f8b1 ReaderHighlight: adjustable "Edit highlight" dialog position (#12599) 2024-10-11 19:26:33 +03:00
hius07
92bcbe06f6 readertypeset: fix margins info (#12609) 2024-10-07 22:17:14 +03:00
Benoit Pierre
120d418b7e android: switch to monolibtic mode (#12576)
We can get rid of the `libs` and `sdcv` symlink in application files.

Depend on koreader/koreader-base#1920.

Close #12348.
2024-10-02 09:19:57 +02:00
David
08205c47c8 [ReaderFooter] Update status bar in real time when inverting page turning (#12424) 2024-09-25 21:16:06 +02:00
NiLuJe
e887be693f optionsutil: Simplify the public formatFlexSize wrapper
Pull the dimension_units from in there,
instead of asking callers to do that.
2024-09-16 17:12:43 +02:00
NiLuJe
3cbd75b385 ReaderTypeset: Use formatFlexSize in onSetPageMargins
Instead of enforcing px.

Also decouple the footer from the bottom margin report to make things
clearer given this change.
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
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
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
hius07
bf290e0c2b Write highlights into PDF: revisited (#12509) 2024-09-14 15:21:26 +03:00
hius07
d3beecd3f5 ReaderAnnotation: skip old highlights with invalid xpointers (#12494) 2024-09-14 11:17:26 +03: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
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
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
Rowan Decker
60e0e3ef45 Add color highlight menu (#11044) 2024-08-30 22:10:43 +02:00
NiLuJe
5fc5386e87 ReadTimer: Don't blindly repaint the footer in update_status_bars
Send a dedicated event that will let ReaderFooter check if we actually have anything relevant to display, and will do the usual "should I repaint/refresh" checks ;).

Fix #12323
Regression since #12002
2024-08-28 23:53:38 +02:00
NiLuJe
a86271b8f1 ReaderFooter: Use maybeUpdateFooter in onBookMetadataChanged
I'm not sure that one could ever have been truly problematic, but let's
be cautious ;).
2024-08-28 23:53:38 +02:00
jonnyl2
f3005906d4 Readerfont: current font on top in menu; new fonts from current session on top in font test doc (#12410)
* Move down call setupFaceMenuTable(); list current font on top in menu if sorted by recently selected.

* New fonts from current session listed on top in fonts test documents; small wording changes
2024-08-26 22:51:29 +02:00
David
dd9f96eddb ReaderFooter: fix page-turn item (#12388)
Account for per-document reading order direction adjustments.
2024-08-25 22:44:19 +02:00
poire-z
9f308399f9 Book style tweak editor: fix double notification on discard
Avoid two identical stacked notifications "Book tweak not modified"
after Close + Discard when text was modified.
2024-08-25 22:39:31 +02:00
poire-z
db8786f058 ReaderRolling: fix batched notifications sometimes not shown
When a profile changes a few settings (ie. font), a few notifications
may be stacked, before the single rerendering happens. If that rendering
takes some time, the notifications' timeout may close them as soon
as it is done, before they get a chance to be painted/refreshed.
So, delay a bit more that rerendering to be sure the notifications
are shown.
2024-08-25 22:39:31 +02:00
NiLuJe
9cd305177e FocusManager: Fix focus_flags check in moveFocusTo, and deal with the fallout (#12361)
* FocusManager: Fix `focus_flags` check in `moveFocusTo` (0 is truthy in Lua, can't do AND checks like in C ;).)
* FileManager+FileChooser: Pass our custom title bar directly to FileChooser (which also means we can now use FC's FocusManager layout directly).
* FileChooser/Menu: Get rid of the weird `outer_title_bar` hack, and simply take a `custom_title_bar` pointer to an actual TitleBar instance instead.
* FileManager/Menu/ListMenu/CoverMenu: Fix content height computations in `_recalculateDimen` (all the non-FM cases were including an old and now unused padding value, `self.header_padding`, leading to more blank space at the bottom than necessary, and, worse, leading to different item heights between FM views, possibly leading to unnecessary thumbnail scaling !)
* ButtonDialog: Proper focus management when the ButtonTable is wrapped in a ScrollableContainer.
* ConfigDialog: Implement a stupid workaround for a weird FocusManager issue when going back from `[⋮]` buttons.
* ConfigDialog: Don't move the visual focus in `update` (i.e., we use `NOT_FOCUS` now that it works as intended).
* DictQuickLookup: Ensures the `Menu` key bind does the exact same thing as the hamburger icon.
* DictQuickLookup: Ensure we refocus after having mangled the FocusManager layout (prevents an old focus highlight from lingering on the wrong button).
* FileChooser: Stop flagging it as no_title, because it is *never* without a title. (This behavior was a remnant of the previous FM-specific title bar hacks, which are no longer a thing).
* FileChooser: Stop calling `mergeTitleBarIntoLayout` twice in `updateItems`. We already call Menu's, which handles it. (Prevents the title bar from being added twice to the FocusManager layout).
* FocusManager: Relax the `Unfocus` checks in `moveFocusTo` to ensure we *always* unfocus something (if unfocusing was requested), even if we have to blast the whole widget tree to do so. This ensures callers that mangle self.layout can expect things to work after calling it regardless of how borked the current focus is.
* FocusManager: Allow passing `focus_flags` to `refocusWidget`, so that it can be forwarded to the internal `moveFocusTo` call.
* FocusManager: The above also allows us to enforce a default that ensures we do *not* send a Focus event on Touch devices, even if they have the hasDPad devcap. This essentially restores the previous/current behavior of not showing the visual feedback from such focus "events" sent programmatically, given the `focus_flags` check fix at the root of this PR ;).
* InputDialog: Fix numerous issues relating to double/ghost instances of both InputText and VirtualKeyboard, ensuring we only ever have a single InputText & VK instance live.
* InputDialog: Make sure every way we have of hiding the VK play nice together, especially when the `toggleKeyboard` button (shown w/ `add_nav_bar`) is at play. And doubly so when we're `fullscreen`, as hiding the VK implies resizing the widget.
* InputText: Make sure we're flagged as in-focus when tapping inside the text field.
* InputText: Make sure we don't attempt to show an already-visible VK in the custom `hasDPad` `onFocus` handler.
* Menu: Get rid of an old and no longer used (nor meaningful) hack in `onFocus` about the initial/programmatically-sent Focus event.
* Menu: Get rid of the unused `header_padding` field mentioned earlier in the FM/FC fixes.
* Menu: Use `FOCUS_ONLY_ON_NT` in the explicit `moveFocusTo` call in `updatePageInfo`, so as to keep the current behavior of not showing the visual feedback of this focus on Touch devices.
* Menu: Make sure *all* the `moveFocusTo` calls are gated behind the `hasDPad` devcap (previously, that was only the case for `updatePageInfo`, but not `mergeTitleBarIntoLayout` (which is called by `updateItems`).
* MultiInputDialog: Actively get rid of the InputText & VK instances from the base class's constructor that we do not use.
* MultiInputDialog: Ensure the FocusManager layout is *slightly* less broken (password fields can still be a bit weird, though).
* TextViewer: Get rid of the unfocus -> layout mangling -> refocus hack now that `refocusWidget` handles this case sanely.
* VirtualKeyboard: Notify our parent InputDialog when we get closed, so it can act accordingly (e.g., resize itself when `fullscreen`).
* ScrollableContainer: Implement the necessary machinery for focus handling inside ButtonDialog (specifically, when scrolling via PgUp/PgDwn).
* TextEditor: Given the above fixes, the plugin is no longer disabled on non-touch devices.
* ReaderBookMark: Make sure we request a full refresh when closing the "Edit note" dialog, as CRe highlights may extend past its dimensions, and if it's closed separately from VK, the refresh would have been limited to its own dimensions, leaving a neat InputDialog-sized hole in the highlights ;).
2024-08-25 19:34:31 +02:00
David
4910afffdd Add numerical key_codes to event_map on kindle 3 (#12358) 2024-08-24 14:17:40 +02:00
Frédéric Brière
39fa008e21 Bookmarks: refresh list entry when closing Bookmark details dialog with X (#12390)
Also: refresh dogear state for current page when closing Page browser
or Book map, as we may have toggled bookmark on it.
2024-08-21 23:46:51 +02:00