2
0
mirror of https://github.com/koreader/koreader synced 2024-11-10 01:10:34 +00:00
Commit Graph

1675 Commits

Author SHA1 Message Date
ziz57
e4232078ab
Readerlink: allow registering empty scheme (#12019)
This allows plugins to handle relative and otherwise schemeless URLs.

Also: clear registered schemes on each init(), to parallel the situation
with external link buttons, and add documentation.
2024-06-13 10:29:43 +02:00
zwim
09822ba552
[AltStatusBar] Fix when showing (almost) empty (#12003)
With enabled battery percentage shown and some other (e.g. reading percentage) the alt status bar shows the expected line. But when disabling everything except battery percentage, then the reading percentage keeps being shown.

So when using this `self:page_info_override` caching trick, we have to restore the cre default again.
2024-06-09 21:13:14 +02:00
zwim
c8f4008e9b
AltStatusBar: fix battery percentage not shown (#11976) 2024-06-08 09:36:50 +02:00
David
81d2db150f
ReaderThumbnail: change base class to support key events (#11987)
fixing bug reported here https://github.com/koreader/koreader/pull/11916#issuecomment-2151903891
2024-06-06 22:26:30 +02:00
hius07
585afda4be
File searcher: group operations (#11980) 2024-06-06 11:44:03 +03:00
David
04eec52eee
BookMap on devices with useDPadAsActionKeys (#11916)
as first discussed here #11908. This PR brings the book map to non-touch devices that useDPadAsActionKeys().

Book map can be accessed from the menu or by using the following shortcut: ScreenKB + Down or Shift + Down depending on whether you use a K4 device or a kindle with keyboard respectively.

Inside the book map, a user can toggle the hamburger menu by pressing the Menu key and make any adjustment from there. ScreenKB (or Shift) + Up/Down allows it to scroll and Page turn buttons to move by whole full page turns. Back key allows user to exit the map.
2024-06-05 22:50:22 +02:00
David
21213f35af
Minor wording corrections (#11981)
see #11978
2024-06-05 22:23:00 +02:00
poire-z
14b7971529
AltStatusBar: fix page info when not all 3 items enabled (#11965)
Fix issue noticed at https://github.com/koreader/koreader/pull/11873#issuecomment-2144485909.
2024-06-04 20:55:11 +02:00
ziz57
93407c8947
Readerlink: fix scheme detection for external links (#11942)
Following RFC 3986.
2024-06-01 13:08:26 +02:00
Benoit Pierre
4c6919ac2a bump base: update tesseract, leptonica and libk2pdfopt
- update leptonica to 1.84.1
- update tesseract to 5.3.4
- update libk2pdfopt to 2.55
2024-06-01 09:56:36 +02:00
hius07
b06272592d
Annotation list: flexible item heights (#11918) 2024-06-01 10:32:15 +03:00
SomeGuy
512065fa14
ReaderLink: make AddCurrentLocationToStack always show notification when activated via keypress (#11925)
As seen here https://github.com/koreader/koreader/pull/11900#discussion_r1615474301.
2024-05-31 22:36:03 +02:00
SomeGuy
1aefd80ea6
ReaderBookmark: "bookmark current page" removed from NT kindles (#11907)
Discussed https://github.com/koreader/koreader/issues/11834#issuecomment-2132411929 onwards.
2024-05-27 12:04:24 +02:00
Frans de Jonge
94372c2adf
Remove ShowFontMenu (#11904)
Some clean up, as suggested in <https://github.com/koreader/koreader/pull/11864#discussion_r1615312993>.
2024-05-27 11:03:50 +02:00
Frans de Jonge
ffc43030ec
ReaderLink: change (hasScreenKB or hasSymKey) add to notification stack shortcut to Press instead of Down (#11905)
See 316c6a0624 (r1615314584)
2024-05-27 09:06:51 +02:00
hius07
9223cde2bd
Status bar: fix book progress (#11885) 2024-05-27 07:42:49 +03:00
Frans de Jonge
8f2bd5420d
Introduce Device:useDPadAsActionKeys() (#11900)
1. Non-Kindle-specific `hasFiveWay` behavior is changed to `hasDPad and useDPadAsActionKeys`. For now they remain Kindle-specific in practice, unless one sets `useDPadAsActionKeys = yes` in a user patch.
2. With that disambiguation out of the way, `hasFiveWay` itself is further disambiguated into `hasScreenKB` and `hasSymKey`, as per the actual property being used, rather than something that tends to correlate with it. (It needn't be Kindle-specific per se, but non-Kindle devices have equivalent shortcuts with for example `Shift`.)
  Running the emulator with `DISABLE_TOUCH=1` will set `hasSymKey = yes`, which can be tested with right shift.

Closes #11887.
2024-05-26 21:25:54 +02:00
Frans de Jonge
a21db40745
[i18n] ReaderBookmark: don't bother translators with a space (#11902) 2024-05-26 17:53:39 +02:00
SomeGuy
00d0affd70
Remove very long press settings from NT (#11898) 2024-05-26 15:34:29 +02:00
ziz57
7925455b68
Add ReaderLink::registerScheme for plugins handling non-http(s) links (#11889)
Currently, links with a scheme other than http or https are rejected. But plugins may want to handle them. This allows them to, by registering the scheme with self.ui.link:registerScheme("example") during the plugin's init.
2024-05-25 23:38:44 +02:00
poire-z
f00a88aef7 AltStatusBar: show page info similar as in footer
We now build the "page/total %" string ourselves,
with the same logic as used in the footer (including
when hidden flows or reference page numbers are used)
and give it to crengine to be displayed instead of
its own way of doing it.
2024-05-24 09:36:19 +02:00
poire-z
54a0cdd737 ReaderFooter: fix minor issues with pages left & chapter progress
When using Reference page numbers, "Pages left" was showing the
same info as "Current page", because Reference pages, being strings,
couldn't be used for arithmetics. But we can just count the number
of items left in the Reference pages array of strings.

Also fix edge case with "page progress" with hidden flow when
we are before the first chapter with a hidden flow before.
2024-05-24 09:36:19 +02:00
SomeGuy
e859109885
Status bar: major UI makeover (#11678) 2024-05-21 21:13:53 +02:00
SomeGuy
577c5d454f
Non-touch DPad improvements (#11749)
Closes #11295.
2024-05-20 21:20:50 +02:00
yparitcher
59fb906921
NetworkListener: fix FM integration & properly gate behind hasWifiToggle (#11858) 2024-05-20 08:37:40 +02:00
Nico Hirsch
3b97e2988a
Shorten home folder path for info messages (#11853)
The info messages for opening files always show the full path. By using `filemanagerutil.abbreviate`, the info messages now show the shortened home folder path (only if the setting "shorten home folder" is enabled).
2024-05-19 13:19:38 +02:00
hius07
6b192c346a
Annotations: Bookmark list improvement (#11825) 2024-05-16 21:57:04 +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
nairyo
126c01e1b5
Replace tweak_buttons_func with an event instead (#11777)
Also see https://github.com/Ajatt-Tools/anki.koplugin/issues/22
2024-05-16 20:44:01 +02:00
hius07
db63db11b2
FileManager: safe initial path (#11774)
We do not like trailing slash in the path (except root).
Closes #11772.
2024-05-16 20:42:08 +02:00
SomeGuy
baab326332
[ReaderHighlight] Remove duplicated setting on NT devices (#11750)
Closes #11747.
2024-05-11 21:25:50 +02:00
hius07
12c3c190b0
Annotations: fixes 2 (#11788)
* readerbookmark: fix index for reverse sorting

* readerhighlight: fix pdf tap on highlight detection
2024-05-09 20:53:53 +03: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
poire-z
001e90db1e ReaderSearch: delay adding to location stack until we change page
Search may highlight matches on the current page, and if there
are no others in the book, we would stay there and resume reading;
but we would get a spurious previous location (ie. in Book map)
that we would not expect keeping, and we may accidently go back
to previous location, losing our reading position.
Avoid this by only adding current page to location stack when
actually leaving the current page.
Because of complications with other reading modes, this is
currently only enabled for CRE document when in page mode.
2024-05-05 21:02:21 +02:00
poire-z
7d94562602 ReaderToc: fix issues when on a page before first Toc Item
When on a page before the first ToC item (the first chapter),
that first chapter title may be shown in the footer instead
of a more correct blank title.
This bug might still have had other small effect elsewhere.
2024-05-05 21:02:21 +02:00
poire-z
ca90b982b4 ReaderStyleTweak: reword CSS suggestions info text 2024-05-05 21:02:21 +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
vyaus
f793c6a36c
Gesture: add jump to random page (#11727) 2024-04-28 17:03:58 +02:00
SomeGuy
c70c9f0905
Hide hidden flows and custom toc from non-touch devices (#11690) 2024-04-18 13:16:27 +02:00
SomeGuy
279f16aa23
Sleep screen menu reworked (#11549) 2024-04-08 22:47:17 +02:00
Frans de Jonge
ec54afcc0d
[minor] ReaderStyletweak: fix typo (#11616) 2024-04-04 16:01:49 +02:00
SomeGuy
f6588e95e8
ReaderHighlight: ~~strikeout~~ → Strikethrough (#11619) 2024-04-04 11:22:36 +02:00
Frans de Jonge
b1a80921ad
Revert "ReaderPaging: enable Kindle page-turn animations (#11424)" (#11617)
This reverts commit ee7c3ab551.
2024-04-03 19:04:27 +02:00
SomeGuy
fbd3e822fe
ReaderView: increase underline thickness (#11586)
Closes #11581.
2024-03-29 09:38:31 +01:00
dkabot
ee7c3ab551
ReaderPaging: enable Kindle page-turn animations (#11424)
Fixes #11423.
2024-03-26 14:49:17 +01:00
Denis Malinovsky
f4a8514545
ReaderTypography: update menu features symbols for Russian (#11570) 2024-03-20 23:24:49 +01:00
poire-z
67cd647d1a
ReaderToc: add option to show chapter lengths (#11546) 2024-03-20 10:09:44 +01:00
Frans de Jonge
9387fcd2d0
[fix] ReaderLink: fix copy link (#11569)
Fixes #11567.
2024-03-18 17:36:01 +01:00
hius07
bb98cbf612
ReaderStatus: update status modification time (#11568)
In the "End of the book" action.
Closes #11564 (No idea how we got a book without modification time but the time stamp must be updated in any case)
2024-03-18 17:35:35 +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
Jo Van Bulck
4d19ce24ed
Dictionary: Fix download message when connection fails (#11548) 2024-03-14 16:58:47 +01:00
poire-z
9a84755e56
Wikipedia EPUBs: add settings for include/highres images (#11544)
Allows setting a default answer to the "Include image"
and "slightly higher quality images" questions when
saving a Wikipedia article as EPUB.
2024-03-14 00:16:52 +01:00
poire-z
191ef2b4c0
Book style tweak: add more suggestions in "CSS ≡" (#11533) 2024-03-14 00:16:09 +01:00
hugleo
b026f84949
ReaderZooming: make auto-crop default be page content (#11438) 2024-03-14 00:15:10 +01:00
hius07
5414858b74
Menu widget: fix item property name (#11534) 2024-03-12 08:51:33 +02:00
poire-z
9467034f3f ReaderTypeset: tweak Style> menu logic and defaults
- Reword and document most menu items.
- Handle internally two default styles, one applying only
  to FB2/FB2 books, and the other to all other formats.
- Also don't reset the stylesheet to epub.css when
  toggling Embedded Styles to off.
2024-03-10 17:06:14 +01:00
hius07
6f896e9383
ReaderFooter: chapter progress bar (#11505) 2024-03-10 08:05:30 +02:00
hius07
bdb1c3135c
Fulltext search: default mode, fixes (#11507) 2024-03-10 07:57:50 +02:00
hius07
8df885438c
Bookmarks: edit highlighted text (#11484) 2024-03-09 17:03:43 +02:00
hius07
7edb64ecee
Upper menu: fix generating the menu (#11513)
revert all changes to the upper menu made in #11495
2024-03-05 07:38:06 +02:00
hius07
ec98c6334b
MenuSearch: open upper menu when needed only (#11495) 2024-02-28 07:29:33 +02:00
hius07
db2336440f
Alt status bar: custom metadata support (#11463) 2024-02-18 08:06:50 +02: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
hugleo
ef0077df23
ReaderPaging: fix offset issue on next page in pan zoom (#11408) 2024-02-17 01:31:31 +01:00
hugleo
041117cbb6
ReaderZooming: revert Autocrop fix (#11325)
From f990937f9f.
2024-02-17 01:26:21 +01:00
poire-z
d77b511849 bump crengine: text selection and footnotes fixes and tweaks
Includes:
- LvDocView: allow setting custom title/authors/series
- elementFromPoint(): fix possible crash when float at end of document
- Non-linear fragments: fix generic handling on erm_final
- DrawBorder: fix bottom border inset/outset drawing
- getSegmentRects(): allow segments to include images
- getRangeText(): allow gathering images
- Allow standalone image in link to trigger in-page footnotes
- ldomDocument::render(): avoid uneeded deserialization on each page turn
- lvtinydom: add ldomNode::getAllInnerAttributeValues()
- LVFootNote: avoid retrieving internal CompactArray object
- In-page footnotes: allows for multiple id= inside them

cre.cpp:
- rename overrideDocumentProp() to setAltDocumentProp()
- isLinkToFootnote(): handle image-only links
- text selection functions: add includeImages param
2024-02-17 00:33:03 +01:00
Frans de Jonge
bdd475f55f
[i18n] ReaderSearch: add translation context to "All" button (#11352)
Cf. https://github.com/koreader/koreader/pull/11313/files#r1439406753
2024-02-08 17:40:41 +01:00
hius07
b8090c641c
Minimize DocSettings:open() calls (#11437) 2024-02-07 10:35:52 +02:00
hius07
925aa728c9
Fulltext search: action to show last findall results (#11388) 2024-01-20 10:00:21 +02: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
NiLuJe
90ae4acca6 Chore: Review FrameContainer constructors for shared dimen objects
Nothing else seems problematic, this is mostly just cosmetic sanitization
around Geom objects.
2024-01-19 00:08:10 +01:00
poire-z
43d36b2ea9 TextBoxWidget: allow showing bits of text in bold
Allow for embedding "tags" (invalid Unicode codepoints)
in the text string to trigger some text formatting:
for now only bolding some parts of text is possible.

Use it with fulltext search "all results" to highlight the
matched word (instead of the previously used brackets).
2024-01-18 12:51:10 +01:00
poire-z
487e5f667a ReaderThumbnail: prevent standby during thumbnails generation
PageBrowser could have strange issues on devices with
aggressive autostandby (ie. failure to read data
from subprocess).
2024-01-18 12:51:10 +01:00
NiLuJe
5bd78ab3b4 ReaderHighlight: Don't try to close a non-existent widget in onClose 2024-01-15 04:29:09 +01:00
NiLuJe
d205c72119 ReaderStatus: Fix some more lifecycle issues in onEndOfBook
Delay anything that attempts to destroy the current document instance if
we're inside an event handler.

Re: https://github.com/koreader/koreader/issues/11147#issuecomment-1891005869
2024-01-15 04:29:09 +01:00
hius07
0ceb88a9a3
Fulltext search: all entries in entire document (#11313) 2024-01-13 12:58:05 +02:00
poire-z
a025faae4e Text selection: show top left icon when very-long-press delay reached 2024-01-13 10:13:47 +01:00
poire-z
455e904120 Text selection: add option to disable corner scroll
People using 2-steps text selection (via the Select button) may
want to not be annoyed by this feature.
Also tweak a bit its behaviour, requiring now the text selection
to come from outside a corder into a corner to activate it, which
should allow starting text selection from a corner without
triggering a scroll yet.
2024-01-13 10:13:47 +01:00
NiLuJe
8968c41070 i18n: Some more unicode escapes => raw bytes shenanigans
Fix #11332
2024-01-13 02:03:10 +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
hius07
7a421ea3ab
Fix "Open next file" (#11272) 2023-12-27 08:45:52 +02:00
hius07
f765fe3070
Screenshot: set as book custom cover (#11227) 2023-12-16 10:36:57 +02:00
hius07
f4a5a2b60a
TextViewer: add dialog to set font size and justify text (#11210) 2023-12-14 07:50:54 +02:00
hugleo
f990937f9f
Autocrop fix (#11194)
After some tests with the said document from https://github.com/koreader/koreader/issues/970 it seems like that the visual defect occurs for only semi-auto and manual crop modes.

I've removed auto-crop from the rule so fixes https://github.com/koreader/koreader/issues/4106 when using auto-crop.
2023-12-04 12:10:43 +01:00
poire-z
b361cec4ff ReaderStyleTweak: minor CSS suggestions popup fixes 2023-12-02 22:51:51 +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
d99c70b5e1
ReaderHighlight: adjustable highlight dialog position (#11116) 2023-11-19 09:52:51 +02:00
hius07
da8e23c011
InputDialog: tap outside to close dialog if keyboard is hidden (#11094) 2023-11-12 07:44:56 +02:00
poire-z
894cb3190d
Page browser: show nightmode thumbnails when in nightmode (#11091)
Just prevent page thumbnails ImageWidgets to be nightmode
inverted, unlike all other ones which are expected to be
double inverted to get their original colors shown.
The same thumbnail can be used and cached in both day and
night modes, unless "nightmode_images" is enabled and have
crengine itself invert images, making thumbnails different.
2023-11-10 20:36:57 +01:00
hius07
51f3115b90
Profiles: fix updating gestures (#11072) 2023-11-08 07:39:59 +02:00
hius07
68aa209a6c
Open with... improvement (#11056)
Allows associating filetypes with non-document providers (like ImageViewer or TextViewer) to "open" (view) these files by a tap in file browser.
2023-11-05 07:24:18 +02:00
hius07
6b892a65a3
ReaderHighlight: delete highlight in view note dialog (#11039) 2023-10-29 11:33:29 +01:00
hius07
2ed2c2c23d
md5: centralize and deduplicate (#11003)
Document partial md5 hash is calculated by util.partialMD5() and stored in doc_settings as "partial_md5_checksum" on the first document opening.
2023-10-15 07:47:09 +03:00
François Gannaz
11083022b0
Minor code quality improvements (#10905) 2023-10-12 14:52:11 +02:00
poire-z
ea3f8951a3 Add ReaderHandmade: support for custom TOC and hidden flows
Checkboxes under TOC>Settings> allow enabling Custom TOC
and Custom hidden flows (similar to "Hide non-linear fragments"
available with some EPUBs).
Handled by a new ReaderHandmade module.
Adding and removing TOC chapters is done in PageBrowser
with long-press on a page thumbnail, and for chapters also
in the popup dialog after selecting some text in a page.

ReaderToc: add a symbol in title when the TOC is the
alternative TOC or the custom TOC.
2023-10-09 00:15:05 +02:00
poire-z
c51b0c7bb9 BookMap: add option Alternative theme
When enabled in BookMap, both BookMap and PageBrowser get:
- alternating gray background on chapter spans
- hatched background instead of uni-gray on hidden flows.
Also, with both normal look and this alternative theme,
show some hatched overlay on thumbnails part of hidden flows.

ReaderToc: for each TOC item, have it carry its sequence/number
in that level (we do this in validateAndFixToc() where we are
already iterating all the items).
2023-10-09 00:15:05 +02:00
poire-z
35f16f87a4 ReaderThumbnail: fix slow thumbnails when in scroll mode
If originally with two-columns in page mode, and switching
to scroll mode, thumbnails generation would be slow as
the document would be rerendered for each thumbnail.
2023-10-09 00:15:05 +02:00
poire-z
5ec736ae96 ReaderToc: rework getChapterPageCount/Left/Done()
Rework the way they are computed, fixing issues with hidden
flows when they don't coincide with chapter starts.
2023-10-09 00:15:05 +02:00