Commit Graph

1595 Commits (master)

Author SHA1 Message Date
NiLuJe 8968c41070 i18n: Some more unicode escapes => raw bytes shenanigans
Fix #11332
4 months ago
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.
4 months ago
hius07 7a421ea3ab
Fix "Open next file" (#11272) 5 months ago
hius07 f765fe3070
Screenshot: set as book custom cover (#11227) 5 months ago
hius07 f4a5a2b60a
TextViewer: add dialog to set font size and justify text (#11210) 5 months ago
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.
5 months ago
poire-z b361cec4ff ReaderStyleTweak: minor CSS suggestions popup fixes 6 months ago
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
6 months ago
hius07 d99c70b5e1
ReaderHighlight: adjustable highlight dialog position (#11116) 6 months ago
hius07 da8e23c011
InputDialog: tap outside to close dialog if keyboard is hidden (#11094) 6 months ago
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.
6 months ago
hius07 51f3115b90
Profiles: fix updating gestures (#11072) 6 months ago
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.
6 months ago
hius07 6b892a65a3
ReaderHighlight: delete highlight in view note dialog (#11039) 7 months ago
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.
7 months ago
François Gannaz 11083022b0
Minor code quality improvements (#10905) 7 months ago
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.
7 months ago
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).
7 months ago
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.
7 months ago
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.
7 months ago
poire-z e6ac74c1df ReaderPaging: use document:getNext/PrevPage()
instead of doing arithmetic (ie. new_page=cur_page+1).
This makes it ready to work with custom hidden flows
where these document:getNextPage()/getPrevPage() will
be overloaded to skip pages in hidden flows.

Also fix some odd issues (page truncated or with parts
duplicated) with scrolling/page turning when at start
or end of the document.
7 months ago
Benoit Pierre 5b5b4d9ebc
readerhighlight: fix OCRed text dictionary lookups (#10967)
Cf. #10966.
8 months ago
NiLuJe e5535a3a3a
ReaderRolling: Guard against races between scheduled tasks and CloseDocument (#10934)
Fix #10932

---------

Co-authored-by: Frans de Jonge <fransdejonge@gmail.com>
8 months ago
hius07 9f39614e8a
Custom metadata: fixes 2 (#10919) 8 months ago
hius07 ed5c1cef20
ButtonTable: remove unused (#10926) 8 months ago
hius07 684fc22ffc
TextViewer: font size (#10911) 8 months ago
hius07 be125af949
Actions for Go to first/last bookmark (#10899) 8 months ago
hius07 3f677a7fdd
copt/kopt options: deduplicate some defaults (#10893) 8 months ago
hius07 cc82ead981
copt deduplicate: font settings (#10885) 8 months ago
hius07 6efcf96b75
copt deduplicate: font_size, visible_pages (#10882) 8 months ago
hius07 7d626456a3
copt deduplicate: render_dpi, margins, rotation_mode (#10880) 8 months ago
hius07 73378cd9d7
copt deduplicate: line_spacing (#10768) 8 months ago
hius07 5e74f29fba
copt deduplicate: embedded_css, embedded_fonts (#10876) 8 months ago
hius07 e4ba8c7909
Custom metadata: event (#10869) 8 months ago
hius07 912ae156f7
copt deduplicate: smooth_scaling, nightmode_images (#10801)
Main discussion in #10763.
8 months ago
hius07 a767ad44db
PDF contrast: incorrect set by a gesture (#10798) 9 months ago
NiLuJe 4cc620b702
VirtualKeyboard: Revamp visibility handling (#10852)
Move as much of the state tracking as possible inside VirtualKeyboard itself.
InputDialog unfortunately needs an internal tracking of this state because it needs to know about it *before* the VK is shown, so we have to keep a bit of duplication in there, although we do try much harder to keep everything in sync (at least at function call edges), and to keep the damage contained to, essentially, the toggle button's handler.

(Followup to #10803 & #10850)
9 months ago
hius07 ed2ea6803f
Custom metadata (#10861) 9 months ago
hius07 1ef7821b66
getProps: centralize 2 (#10837)
Centralize and optimize handling document properties.
9 months ago
NiLuJe 7e628958b6 Misc: review pass for #10803 9 months ago
NiLuJe a15fc0e9a5 Revert "Test: Fiw readerhighlight test"
This reverts commit c23c422f62.
9 months ago
NiLuJe ae7e2f14aa Test: Fiw readerhighlight test
With actual ReaderUI teardowns, and fix the overlapping highlight
handling, so we can drop the nocov flags
9 months ago
NiLuJe 55534fcec2 ReaderView: Keep the terrible readerhilight_spec test happy
This thing is a horrible mess.
9 months ago
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
9 months ago
NiLuJe 22678ee5ff Misc: Review pass on the previous commits
* Unbreak the Device test
* Rename a few things
* Tweak a few comments
9 months ago
NiLuJe 71378b0b50 Startup: Move Device ctor/dtor shenanigans to the actual Device
constructors and destructors

No need to leak implementation details in there.
9 months ago
NiLuJe 4acf131071 ReaderActivityIndicator: Oh god, my eyes, they buuuuurn.
Make this a real boy, with a transient lipc handle.
And get rid of the insane 1s sleep on affected ReaderView paints,
because ouchy.

This is completely deprecated anyway, so this is entirely pointless,
and mainly to prevent implementation details from creeping into
reader.lua.
9 months ago
NiLuJe ac1358e0f0 Menu: Actually hide PlatformNav if !hasKeys
Returning {} just leads to a present but blank entry

(Also, nobody notice that the capcheck was wrong inside platnav anyway ;p).
9 months ago
NiLuJe 6283674c47 Menu: Split off "Page Turns" submenu in two sections
The Kindle swipe animations & physical key inversion apply *everywhere*,
so we need this accessible in the FM, too.

Move it to Navigation, which is where it already was on !Touch devices.
9 months ago
poire-z 626864f856 [chore] replace utf8 bytes with Unicode escape sequence 10 months ago
NiLuJe ef0bcbad3f
ReaderFooter: Don't reset the initial position marker like a cowboy (#10767)
Take a more tactful approach instead, should hopefully prevent issues like in https://github.com/koreader/koreader/pull/10114#issuecomment-1658913661
10 months ago
hius07 47dae6c5dd
Dictionary: fix Fuzzy search setting appearance (#10721) 10 months ago
hius07 a311de6d8e
readerview: do not read/save inapplicable doc_settings items (#10710) 10 months ago
poire-z 8a240dd635
bump LunaSVG, crengine: add support for .docm (#10702)
Includes:
- bump LunaSVG: intermediate upstream bump, cleanup
- bump LunaSVG: minor upstream tweaks
crengine:
- DocX: add support for similar DocM format
- LVStyleSheet: fix LVCssDeclaration::getHash()
- CSS parsing: accept Unicode values for ID and classnames
- update for Harfbuzz 8, fix some compiler warning
Also fix input not restored when loading failed,
and KOReader not able to exit.
10 months ago
poire-z d0e705a582
Font list menu: allow sorting by more recently set (#10662)
- Add a toggle in Font settings> allowing showing font
  ordered by most recently selected (long-press on
  it allows clearing this history).
- Keep in G_reader_settings a list of known fonts, so
  we can notice newly added user fonts, and put them
  at the start of the most recently selected. Show
  these new fonts with a symbol in the menu.
- TouchMenu: allows for a flag to trigger menu
  refresh when going up.
10 months ago
hius07 e1ed3a71c5
Style tweaks: notification on toggling style tweak with a gesture (#10674) 10 months ago
poire-z dffc2404ca Text search: normalize input text
So that Unicode NFC normalization can combine diacritics
entered via our keyboard with their base into their
canonical form (we can expect books text to be normalized).
11 months ago
hius07 6decb71521
ReaderPaging: do not store zeroes in page_positions (#10602)
Page_position value depends on the view mode parameters, but we can assume that zero is a frequent case.
11 months ago
hius07 dee1c902ec
ReaderUI: minor optimization (#10634) 11 months ago
NiLuJe 08dd97384c
KOSync: Clarify settings, plus refactor & fixes to make "auto-sync" more reliable (#10605)
Fix: #10539, and for context #6489, #6733, #6534

Reorganize and reword most of the settings to make it clear what actually ties into auto sync, and what doesn't. (Specifically, what happens when a pull attempts to sync forward or backward has nothing to do with auto sync, it applies in all cases; while the periodic sync *does* require auto sync).

The main point of contention, though, is that auto sync will now *always* attempt to setup network connectivity (i.e., on resume/suspend/close). Periodic sync will *not* though (the intent being that, if you use periodic sync, you're relying on the activity check to actually keep wifi on at all times)).

Since this may lead to a large amount of nagging about wifi toggles on devices w/ NetworkManager support, it is now *disabled* by default on those devices. (And given that it wouldn't have worked because of the lack of connectivity, that doesn't really make any practical difference ;p).

Additionally, given the fact that there's no way to make this behavior viable if the "before wifi" action is left at its default of "prompt", this feature now *requires* that to be set to "turn_on" (on devices where it can, of course); attempting to toggle it on will warn about that if necessary.
This change is retroactive (OTM).

Includes an assortment of fixes and cleanups, including migrating to the new LuaSettings API, which is why there's no longer a smattering of superfluous flushes.
11 months ago
hius07 eef99dafd6
Overlap: fix detecting reflow mode (#10576) 11 months ago
hius07 46933035c5
Open with: images (#10561) 11 months ago
hius07 23feb0c9cd
Bookmarks: filter by highlight style (#10549) 11 months ago
poire-z 04425b74fc BookMap: add "Overview" mode
Add a restricted but convenient mode showing BookMap like
in initial view, while still allowing chapter levels to be
tweaked. This allows getting back to this view with another
gesture to see the overall progress in the book, while
still having the normal BookMap in flat mode acting as
an alternative ToC.
Available as an action to associate to a gesture, and
with long-press on the "Book map" menu item.
12 months ago
hius07 57f4ff2c68
ReaderHighlight: manage overlapped highlights (#10492) 12 months ago
hius07 919d67656d
readerhighlight: fix translator auto lang (#10469) 1 year ago
hius07 5f59ee6417
readerhighlight: fix translate (#10451)
Fix translation for books without "language" in properties (it is "", Translator expects nil).
Regression after #10438.
1 year ago
hius07 3dce41269d
Translator: translate current page (#10438) 1 year ago
poire-z fc81c7db24 DictQuickLookup: add button to show list of results
Add a left button to the title bar to show the list
of results as a popup.
Dictionary: tap or long-press on that button give
different view of the results.
Wikipedia: request 30 results instead of 20, so we
can show 15, 10 or 6 of them per page of that popup.
1 year ago
hius07 b4f453eb58
Page overlap: add "Horizontal line" marker (#10401) 1 year ago
Frans de Jonge 46f0bba74b
ReaderLink: fix capitalization typo in "Go Forward" (#10399) 1 year ago
yparitcher de5c872dcb Dispatcher: add `addCurrentLocationToStack`
This is useful when i want to reference something a few pages away while keeping track of my current page
1 year ago
hius07 4f23a6fafa
Custom book covers (#10329) 1 year ago
hius07 9db74f1f01
ConfirmBox: add widgets (#10364) 1 year ago
yparitcher 64b0f5e7cf ReaderFooter: separate ToggleFooterMode from TapFooter
the footer can be toggled by gestures and menu, and should only be locked or skim in flipping mode when the footer is tapped

also allow toggling when only displaying the progress bar

rename to TapFooter to show it is not an event

Fixes: #10355
1 year ago
poire-z 7bae2ed920 Dispatcher: add "Save book metadata" 1 year ago
hius07 af45ec75c3
ReaderThumbnails: update cached page thumbnail on bookmark note change (#10303) 1 year ago
hius07 be7d6008d1
Reader: do not apply line spacing out of range (#10307)
* readercoptlistener: fix line spacing out of range

* readerkoptlistener: fix line spacing out of range

* creoptions: fix line spacing limit
1 year ago
zwim 4dbaca180a
PM: Optimize task queue handling around standby (#10203)
Instead of firing on(Enter|Leave)Standby Events, and having every other piece of code that might care about that handle re-scheduling their stuff themselves; simply make the standby implementation (i.e., AutoSuspend's) shift the whole task queue by the amount of time spent in standby to re-sync everything automatically.

(This is necessary in the first place because Linux, as the task queue ticks in CLOCK_MONOTONIC, which does *not* tick during suspend/standby; while we expect most of the tasks scheduled to actually reflect real world clock delays).
1 year ago
hius07 b01e1c5918
Reader: do not apply font size out of range (#10295) 1 year ago
hius07 827581ac72
readerbookmark: fix writing pdf annotation (#10287) 1 year ago
nairyo 983e083a0b
Center pdf manual zoom mode (#10246)
Center PDF content when its width is smaller than the screen

fix #9967
1 year ago
hius07 3a37d30ad6
Dispatcher: use translated labels for Zoom Mode actions (#10269) 1 year ago
yparitcher bc5d354225
ReaderLink: allow a forward location stack (#10228)
this allows going back and forth from links (think of undo / redo)

when going back and no forward locations and when we are not on the same page as the last saved location, add the current location to the forward stack, helping if one goes back by mistake they can jump back to their current location

when going back and no forward locations and when we are not on the same page as the last saved location, add the current location to the forward stack, helping if one goes back by mistake they can jump back to thier current location
1 year ago
hius07 c6a7f083c9
readerstyletweak: update profiles on unregistering in dispatcher (#10247) 1 year ago
poire-z f16fbf1d0b Book style tweak: add button with CSS suggestions
Mostly non-standard CSS declarations (so, possibly unknown
to users) that can be useful for solving certain issues.
1 year ago
hius07 1e6b22a60e
Readerzooming: fix use of default settings (#10205)
(1) Fix default direction. Closes #10201. Fixes #9321.
(2) Fix default overlap (unreported bug).
(3) Do not write unused settings to doc_settings.
1 year ago
poire-z 3006348585 PageBrowser: toggle page bookmark with long-press on thumbnail 1 year ago
nairyo 65031ae14f
Dictionary lookup window: use from/to language to determine glyph form (#10184)
For example, to determine whether the Japanese or Chinese form should be shown.

* Dictionaries.lua - use iso3 codes everywhere
readerdictionary.lua - convert iso to bcp tag, to construct ifo_lang
isolanguage.lua - map from iso3 to full language name, map from iso3 to bcp language tag

* Make the full language names translatable

* Store ifo information from dictionaries.lua in downloaded dictionaries
1 year ago
hius07 536d71970f
Bookmark flipping mode fix (#10196)
(1) Changed indicator icon to "bookmark".
(2) Added toggling action to dispatcher.
1 year ago
poire-z eeb3c08457 View HTML: add CSS helpers with long-press
Move View html code from ReaderHighlight to a new
dedicated module.
Long-press on an element or its text in the HTML will
show a popup with a list of selectors related to this
element that can be copied to clipboard (to be pasted
in Find or in a Book style tweak).
2 addtional buttons in this popup allow seeing all the
CSS rulesets in all stylesheets that would be matched by
this element, which should make it easier understanding
the publisher stylesheets and using or creating style
tweaks.
1 year ago
NiLuJe 189739ac4c
ReaderFooter: Don't reset session marker on standby (#10167) 1 year ago
hius07 55f1b8c974
UX: a set of minor fixes (#10165)
- AutoFrontlight plugin: update checkmark on toggling
- KeepAlive plugin: update checkmark on toggling
- ReaderPageMap: font size menu entry
- ReaderStatus, common_settings_menu_table: book status "read" -> "finished"
1 year ago
hius07 5c9ba53353
History: update last book access time (#10156) 1 year ago
poire-z b610facfdc
Partial rerendering: really avoid flash on reload (#10155)
Also restore input if ReaderUI crashed.
Also avoid refresh_count management when "Full refresh
rate" is set to "never".
1 year ago
hius07 54b3b5a8cc
ReaderHighlight: minor fixes (#10142)
* readerui: save highlight to pdf requires button press

* readerhighlight: fix select mode confirmbox icon
1 year ago
hius07 15605291c2
DocSettings: add support of centralized sdr storage (#10132) 1 year ago
NiLuJe c5d606a7f4
ProgressWidget: Add an optional marker on the initial position (#10114)
* Enable it on SkimToWidget
* Optional on ReaderFooter (toggle in the progress bar > style submenu)
1 year ago
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.
1 year ago
poire-z 2f0954fa71 Book style tweak: revamp sample tweak 1 year ago