Commit Graph

1698 Commits

Author SHA1 Message Date
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
hius07
b937a079ea Profiles: auto-execute on events (#12564) 2024-09-30 19:22:20 +03: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
hius07
9c001a660a PDF: no "Contrast set to" notification on opening (#12391) 2024-08-21 20:57:22 +03:00
hius07
415ce40f84 Touch menu: always go up to correct parent page (#12378) 2024-08-21 20:53:45 +03:00
hius07
ed9cde8feb UX minor fixes (#12374) 2024-08-19 08:10:14 +03:00
hius07
f0c9a642d1 ReaderStatus, Book status widget: cleanup (#12343) 2024-08-19 08:05:19 +03:00
charrarr
91c15d5277 ReaderFont: display preview of italic-only fonts in italic (#12351)
In font selection menus, ask creengine for italic versions
of fonts if there's no regular version to preview.
Also prevents a crash when a font can't be previewed in
the font family menu.
2024-08-18 09:28:23 +02:00
David
3450aaba99 Bug Fix: DPad conflict on Kindle Keyboard (#12341)
* fix conflicting panning and content selection

* accurate keyboard info message
2024-08-13 22:54:08 +02:00
hius07
27e2efcbd2 Annotations: fix page numbers (#12324) 2024-08-13 22:18:24 +03:00
David
f3c0af49c2 Support 'Ctrl' shortcuts on hasKeyboard (#12347) 2024-08-13 20:34:34 +02:00
David
466971c0e2 ReaderFooter: add page-turn item (#12249) 2024-08-10 10:09:23 +02:00
NiLuJe
cafa9c8251 Disable the legacy ReaderRotation module (#12309)
AFAICT, this has never worked since the KPV -> KOReader refactor, as it relies on a weird little DrawContext "feature", while the actually in-use rotation framework is handled via BlitBuffer.

That kludge pollutes *a lot* of both the backend and frontend code, so I plan to annihilate that in a followup PR.

See #12303 for more context
2024-08-08 04:53:04 +02:00
NiLuJe
46a5d20513 Document: Do not cache panel-zoom tiles to disk and fix their caching and rendering (#12303)
* Use a dedicated cache hash for partial tiles from panel-zoom
* Never dump them to disk, as it confuses DocCache's crappy heuristics that rewinds the cache to skip over the hinted page to try to dump the on-screen page to disk.
* Apply the zoom factor in the exact same way as any other page rect (i.e., floor coordinates, ceil dimensions), and make sure said rect is actually a Geom so it doesn't break the cache hash, which relies on Geom's custom tostring method for rects. Said scaling method *also* belongs to the Geom class anyway.
* Handle such pre-scaled rects properly in renderPage, so as not to apply the zoom factor to the full page, which would attempt to create a gigantic buffer.
* And now that the rect is rendered properly in an appropriately-sized buffer, use the rendered tile as-is, no need to blit it to another (potentially way too large because of the above issue) blank BB.
* The zoom factor is now computed for a scale to best-fit (honoring `imageviewer_rotate_auto_for_best_fit`), ensuring the best efficiency (ImageViewer won't have to re-scale).
* Cache: Reduce the maximum item size to 50% of the cache, instead of 75%.
* Warn about the legacy ReaderRotation module, as it turned out to be horribly broken. The whole machinery (which is spread over *a lot* of various codepaths) is left as-is, peppered with notes & fixmes hinting at the problem. Thankfully, that's not how we actually handle rotation, so it was probably hardly ever used (which possibly explains why nobody ever noticed it breaking, and that nugget possibly dates back to the inception of the kpv -> ko refactor!). (#12309)
2024-08-08 04:52:24 +02:00
David
2900eef276 Show/Hide Virtual keyboard and more keyboard shortcuts (#12162) 2024-08-07 18:09:40 +02:00
hius07
975efae929 ReaderSearch: "All text" improve (#12287) 2024-08-06 19:12:16 +03:00
poire-z
949b996ad7 Fix early unhighlight after Add to vocab builder (#12288)
Getting text from xpointers to get the current selected
word context would have crengine unhighlight that word.
Allow to get it selected again when done getting context.
2024-08-04 23:27:30 +02:00
ziz57
c213bd779c ReaderUI: add seamless argument to switchDocument (#12290) 2024-08-04 20:02:45 +02:00