Commit Graph

168 Commits

Author SHA1 Message Date
David
6c25d045eb Invert progress bar direction, independently of UI layout (LTR/RTL) (#13382) 2025-08-29 08:13:01 +02:00
hius07
4c431e7566 Highlights: fix page boxes cache (#13200) 2025-02-07 08:30:21 +02:00
hius07
7dc75d313c Update readerview.lua (#13169)
Fix resetHighlightBoxesCache()
2025-01-30 20:04:52 +02:00
hius07
08b9fd9aa7 "Invert page turn taps and swipes" fix (#13155) 2025-01-28 18:54:31 +02:00
hius07
7444ec53e9 Remove onSetFullScreen() (#12871) 2024-12-09 12:33:16 +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
hius07
97a7ebefb9 Text editor: rotate (#12658) 2024-10-29 20:49:43 +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
hius07
bf290e0c2b Write highlights into PDF: revisited (#12509) 2024-09-14 15:21:26 +03:00
hius07
7572a812cc Highlights popup dialog: add "Color" and "Details" buttons (#12461) 2024-09-07 17:56:40 +03: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
Rowan Decker
60e0e3ef45 Add color highlight menu (#11044) 2024-08-30 22:10:43 +02:00
hius07
9c001a660a PDF: no "Contrast set to" notification on opening (#12391) 2024-08-21 20:57:22 +03: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
NiLuJe
d59c837714 Kobo: Refactor various aspects of the Kaleido/MTK support (#12221)
* UIManager: Let the fb backend deal with Kaleido wfm promotion. This fixes a number of quirks that poisoned the refresh queue with spurious full-screen refreshes. See https://github.com/koreader/koreader-base/pull/1865 for more details.
* This also means we now disable Kaleido waveform modes when color rendering is disabled (remember to trash your thumbnail cache if you don't want to mix color w/ grayscale thumbnails, though).
* UIManager: Merge refreshes that share an edge, because that was driving me nuts (and would have most likely been merged by the kernel anyway). A perfect test-case is the FM, which trips two separate refreshes because of its title bar.
* ReaderFlipping: Use sensible dimensions, so that we only refresh the icon's region.
* ReaderBookmark: Only refresh the dogear instead of the whole page when toggling bookmarks.
* NetworkSetting: Make it a real boy, so it consistently refreshes properly on dismiss instead of relying on UIManager saving the day.
* Kobo: Aggressively prevent *both* suspend & standby while MTK devices are plugged-in, as both will horribly implode the kernel (we previously only prevent standby while charging).
* Kobo: Switch to 8bpp on B&W MTK devices (or when color rendering is disabled on Kaleido panels).
2024-07-28 01:19:40 +02:00
hius07
b17bd967da Page turns: invert vertical tap zones (#12195) 2024-07-24 18:34:23 +03:00
Benoit Pierre
97735ce496 ReaderThumbnail: clear cache on rendering mode change 2024-07-19 21:32:20 +02:00
Benoit Pierre
99d45d7584 djvu: honor render mode when reflowing 2024-07-19 21:32:20 +02:00
hius07
a7d493d966 ReaderView: speedup highlights drawing (#12134) 2024-07-06 15:24:01 +03:00
hius07
46449eb06e Page overlap: add dashed line marker (#11804)
Requested by our contributor in #11734 (comment).
2024-05-16 20:44:53 +02:00
Valentin Dubois
526a1fb727 Initial support for new Kobo (Clara B/W + Colour, Libra Colour) (#11737)
* Support the Clara B&W, Clara Colour & Libra Colour
* Enable HW dithering on *all* the Kobo MTK devices
* Enforce 32bpp instead of 8bpp for Kobo devices with a color panel (the driver doesn't actually support 8bpp anyway)
* Enable standby support on MTK (whenever possible, i.e., not when plugged in, as that is horribly, horribly broken).
* Enforce the dedicated "color" waveform mode for image content in ScreenSaver, ImageViewer & Reader.
* Fix charging LED support on MTK
* Tweak the frontlight ramp on MTK + LM3630 so that it actually ramps smoothly
2024-05-09 03:27:37 +02:00
hius07
725df17c45 Annotations: fixes (#11761) 2024-05-07 19:54:57 +03:00
zwim
bf58723af1 [CoverImage] Honor rotation after opening of a book (#11752)
If rotation changes, create a new cache entry and use that if necessary.

Fixes #11713.
2024-05-06 22:53:13 +02:00
hius07
d82815952e Annotations, part 1 (#11563)
New format to handle annotations (page bookmarks, highlights, notes) and store them in the book metadata files.
2024-05-03 09:08:57 +03:00
SomeGuy
fbd3e822fe ReaderView: increase underline thickness (#11586)
Closes #11581.
2024-03-29 09:38:31 +01:00
hugleo
424fa9b6fd ReaderView: ensure that the pan zoom direction is not nil (#11557)
Fix gif and web files not opening: https://github.com/koreader/koreader/pull/11425#issuecomment-2002164851
2024-03-17 12:13:04 +01:00
hugleo
52fae11da7 ReaderView: ensure pan zoom mode on document open (#11425)
When we open the document for the first time, the pan
positions are not being applied. If I use the bottom-to-top
mode we should see the bottom first, but the top is being
shown instead.
2024-02-17 01:34:40 +01:00
NiLuJe
19ed35e59c ConfigDialog: Don't enforce 0x0 dimensions on initial display
FrameContainer now behaves like other widgets, and no longer re-computes
dimensions in paintTo *if you provide a dimen*.
Since we do here, for.... reasons I'm not entirely sure still make any
sense, make sure we actually compute valid dimensions,
instead of an empty rect from Geom:new ;).

Fix #11389
2024-01-19 21:11:02 +01:00
zwim
2c33fc6576 Reader: Do less work on same-orientation non-gyro rotations (#11297)
Namely, don't recompute layouts, as they do not change.
(The gyro codepaths were already doing something similar.)

* Keep ConfigDialog, FileManagerMenu & ReaderMenu open on rotation.
  (In practice, only ConfigDialog is affected, as *Menu doesn't handle the rotation event.)
* Plugged an instance leak in the aforementioned Menu classes.
* Unify behavior & code with the gyro codepaths.
2024-01-12 19:13:44 +01:00
NiLuJe
82e7ebd6df ReaderView: Flash when paging *away* from images, too (#11152)
Reword the `Always flash around pages with images` Menu/Dispatcher entry
accordingly.

Fix #11143
2023-11-26 05:51:47 +01:00
hius07
3f677a7fdd copt/kopt options: deduplicate some defaults (#10893) 2023-09-13 07:49:57 +03:00
hius07
7d626456a3 copt deduplicate: render_dpi, margins, rotation_mode (#10880) 2023-09-08 08:41:44 +03:00
hius07
a767ad44db PDF contrast: incorrect set by a gesture (#10798) 2023-09-02 09:41:27 +03:00
hius07
ed2ea6803f Custom metadata (#10861) 2023-09-01 08:07:29 +03:00
NiLuJe
a15fc0e9a5 Revert "Test: Fiw readerhighlight test"
This reverts commit c23c422f62.
2023-08-15 21:24:11 +02:00
NiLuJe
ae7e2f14aa Test: Fiw readerhighlight test
With actual ReaderUI teardowns, and fix the overlapping highlight
handling, so we can drop the nocov flags
2023-08-15 21:24:11 +02:00
NiLuJe
55534fcec2 ReaderView: Keep the terrible readerhilight_spec test happy
This thing is a horrible mess.
2023-08-15 21:24:11 +02:00
NiLuJe
0686ee594c ReaderView: Make sure we unschedule the hinting task on actual teardown.
onCloseDocument is way too early, if another, later onCloseDocument
handler trips a ReaderUI repaint, a new task will be scheduled, and that
one will never be cancelled, resulting in it running post-teardown,
crashing horribly.

This was for instance very easy to trigger via KOSync.

Fix #10806
2023-08-15 21:24:11 +02:00
hius07
a311de6d8e readerview: do not read/save inapplicable doc_settings items (#10710) 2023-07-24 09:25:16 +03:00
hius07
eef99dafd6 Overlap: fix detecting reflow mode (#10576) 2023-06-14 07:36:37 +03:00
hius07
b4f453eb58 Page overlap: add "Horizontal line" marker (#10401) 2023-05-07 20:28:18 +03:00
hius07
b01e1c5918 Reader: do not apply font size out of range (#10295) 2023-04-04 08:11:02 +03:00
hius07
536d71970f Bookmark flipping mode fix (#10196)
(1) Changed indicator icon to "bookmark".
(2) Added toggling action to dispatcher.
2023-03-13 09:52:10 +02:00
poire-z
81f2aed086 ReaderRolling: quicker partial rerenderings with EPUBs
Only available with EPUBs containing 2 or more fragments,
and a file size large enough to ensure a cache file is used.
The idea is simply, on any rendering setting change, to
skip the rerendering of the full book and to defer any
rerendering to the moment we draw a DocFragment, and
render only it.
So, on a setting change, only the fragment containing the
current page will be rerendered, and the new fragments we
may cross while turning pages.
When having done so, KOReader is in a degraded state (the
full page count is incorrect, the ToC is invalid...).
So, a full rerendering is needed, and one will happen
in the background, and when the user is idle, we reload
seamlessly and quickly from the cache file it has made.
ReaderFlipping will show some icons in the top left
corner to let it know at which steps in this procress
we are.
2023-02-16 23:36:26 +01:00
NiLuJe
45a4aac3d3 Notification: Fence the *display* update in an attempt to avoid upsetting some boards... (#10083)
Re: https://github.com/koreader/koreader/issues/9806#issuecomment-1416827447

Depends on https://github.com/koreader/koreader-base/pull/1576

Includes assorted cosmetics tweaks related to duplicate `setDirty` calls when instantiating widgets that already have an `onShow` handler doing it. (I left widgets doing it in `update` instead of `init` alone, on the assumption that callers *may* be relying on that behavior when updating widgets at runtime. This might actually never matter, and it certainly didn't for ScreenSaverWidget, which is why I removed it from there ;p).
2023-02-07 01:01:05 +01:00