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

2189 Commits

Author SHA1 Message Date
hius07
ed5c1cef20
ButtonTable: remove unused (#10926) 2023-09-22 09:06:30 +03:00
hius07
684fc22ffc
TextViewer: font size (#10911) 2023-09-19 08:39:25 +03:00
hius07
be125af949
Actions for Go to first/last bookmark (#10899) 2023-09-15 07:24:31 +03:00
hius07
3f677a7fdd
copt/kopt options: deduplicate some defaults (#10893) 2023-09-13 07:49:57 +03:00
hius07
108d87742a
Custom metadata: fixes (#10889) 2023-09-12 07:54:38 +03:00
hius07
cc82ead981
copt deduplicate: font settings (#10885) 2023-09-09 12:44:56 +03:00
hius07
6efcf96b75
copt deduplicate: font_size, visible_pages (#10882) 2023-09-09 09:24:05 +03:00
hius07
7d626456a3
copt deduplicate: render_dpi, margins, rotation_mode (#10880) 2023-09-08 08:41:44 +03:00
hius07
73378cd9d7
copt deduplicate: line_spacing (#10768) 2023-09-08 08:40:47 +03:00
hius07
5e74f29fba
copt deduplicate: embedded_css, embedded_fonts (#10876) 2023-09-06 09:41:41 +03:00
hius07
e4ba8c7909
Custom metadata: event (#10869) 2023-09-06 09:41:10 +03:00
hius07
f46f341b9b
Reset settings/cover/metadata separately (#10866) 2023-09-05 07:42:46 +03:00
hius07
912ae156f7
copt deduplicate: smooth_scaling, nightmode_images (#10801)
Main discussion in #10763.
2023-09-04 23:12:08 +02:00
hius07
a767ad44db
PDF contrast: incorrect set by a gesture (#10798) 2023-09-02 09:41:27 +03:00
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)
2023-09-01 22:51:41 +02:00
hius07
ed2ea6803f
Custom metadata (#10861) 2023-09-01 08:07:29 +03:00
hius07
1ef7821b66
getProps: centralize 2 (#10837)
Centralize and optimize handling document properties.
2023-08-30 07:53:59 +03:00
NiLuJe
a736a3ebe0
Calibre: Add reading status to the metadata search popups (#10842)
We're getting old, remembering whether you've actually read stuff is hard ;).
2023-08-26 16:13:59 +02:00
hius07
33467098dd
filemanager: minor tweaks (#10821) 2023-08-18 08:11:43 +03:00
NiLuJe
7e628958b6 Misc: review pass for #10803 2023-08-15 21:24:11 +02: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
NiLuJe
22678ee5ff Misc: Review pass on the previous commits
* Unbreak the Device test
* Rename a few things
* Tweak a few comments
2023-08-15 21:24:11 +02:00
NiLuJe
71378b0b50 Startup: Move Device ctor/dtor shenanigans to the actual Device
constructors and destructors

No need to leak implementation details in there.
2023-08-15 21:24:11 +02:00
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.
2023-08-15 21:24:11 +02:00
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).
2023-08-15 21:24:11 +02:00
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.
2023-08-15 21:24:11 +02:00
hius07
1544ca28af
FileManager: truncate left in selected files list (#10783)
Truncate the path to view the filename in full. Closes #10760.
2023-08-10 17:01:07 +02:00
poire-z
626864f856 [chore] replace utf8 bytes with Unicode escape sequence 2023-08-02 01:28:24 +02:00
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
2023-08-01 18:43:48 +02:00
hius07
47dae6c5dd
Dictionary: fix Fuzzy search setting appearance (#10721) 2023-07-24 09:25:53 +03:00
hius07
a311de6d8e
readerview: do not read/save inapplicable doc_settings items (#10710) 2023-07-24 09:25:16 +03:00
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.
2023-07-16 19:18:10 +02:00
Glen Sawyer
73c4f09a88
FileChooser: re-add file sort by "last date read" (#10682)
Revert bits from eb299c30.
2023-07-12 22:33:14 +02:00
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.
2023-07-12 22:29:13 +02:00
hius07
e1ed3a71c5
Style tweaks: notification on toggling style tweak with a gesture (#10674) 2023-07-12 07:45:47 +03:00
hius07
b1c90260e4
DropBox: unify error messages (#10666) 2023-07-11 07:49:52 +03:00
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).
2023-07-04 09:03:34 +02:00
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.
2023-07-04 08:43:30 +02:00
hius07
dee1c902ec
ReaderUI: minor optimization (#10634) 2023-07-03 17:43:13 +03:00
hius07
eb299c300d
FileChooser: Sort by date (#10627) 2023-07-03 08:24:28 +03:00
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.
2023-07-03 01:23:14 +02:00
kosmoski
72c1905110
Add 'Content-Length' header to WebDAV upload request (#10567)
Co-authored-by: wojtek <wojtek@pop-os.localdomain>
2023-07-01 07:29:38 +02:00
hius07
45428dda49
History: shorten date/time field (#10594) 2023-06-21 07:33:09 +03:00
hius07
54ab0a04f8
Archive viewer (#10584) 2023-06-21 07:32:24 +03:00
hius07
eef99dafd6
Overlap: fix detecting reflow mode (#10576) 2023-06-14 07:36:37 +03:00
hius07
46933035c5
Open with: images (#10561) 2023-06-12 09:08:56 +03:00
hius07
fc7181419f
CoverImage: custom cover support (#10553) 2023-06-09 10:36:34 +03:00
hius07
23feb0c9cd
Bookmarks: filter by highlight style (#10549) 2023-06-08 08:28:43 +03:00
hius07
01e6593dd4
File popup dialog buttons (#10537) 2023-06-08 08:27:52 +03:00
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.
2023-06-05 00:58:15 +02:00
hius07
1944f54aa0
Custom cover: fix (#10513)
Somehow have overlooked in testing.
Closes #10512.
2023-05-31 14:28:07 +02:00
hius07
57f4ff2c68
ReaderHighlight: manage overlapped highlights (#10492) 2023-05-28 08:05:48 +03:00
hius07
6c0bfb1c0a
FileManagerCollection: Fix crash on "Execute shell script" 2023-05-21 01:23:18 +02:00
hius07
919d67656d
readerhighlight: fix translator auto lang (#10469) 2023-05-20 15:41:50 +03:00
hius07
3d5775241d
Exporter: selected files (#10453)
Export highlights for selected files.
Having a button "Select all files in folder", it is easy to export the whole folder.
So, closes #10402.

To keep even number of buttons, added a feature "Show selected files list". May be useful to check selections before an operation. Just a sorted list, no titlebar or popup menu, tapping a file jumps to its folder.
2023-05-19 09:55:49 +02:00
hius07
5f59ee6417
readerhighlight: fix translate (#10451)
Fix translation for books without "language" in properties (it is "", Translator expects nil).
Regression after #10438.
2023-05-18 21:57:16 +02:00
hius07
3dce41269d
Translator: translate current page (#10438) 2023-05-17 07:34:37 +03:00
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.
2023-05-12 20:12:10 +02:00
hius07
b4f453eb58
Page overlap: add "Horizontal line" marker (#10401) 2023-05-07 20:28:18 +03:00
Frans de Jonge
46f0bba74b
ReaderLink: fix capitalization typo in "Go Forward" (#10399) 2023-05-07 18:36:28 +02:00
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
2023-05-05 08:06:23 +02:00
hius07
4f23a6fafa
Custom book covers (#10329) 2023-05-03 15:43:05 +03:00
hius07
9db74f1f01
ConfirmBox: add widgets (#10364) 2023-05-02 08:25:34 +03:00
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
2023-05-01 15:28:26 -04:00
poire-z
7bae2ed920 Dispatcher: add "Save book metadata" 2023-04-30 20:46:09 +02:00
Frans de Jonge
744f2d185f
[fix] Reintroduce "Start with" default to prevent nil string on startup (#10369)
Regression from #10198.

Fixes #10368.
2023-04-30 13:01:55 +02:00
hius07
99265ba1b7
BookInfo: fix crash on show cover (#10315) 2023-04-16 21:46:09 +02:00
hius07
af45ec75c3
ReaderThumbnails: update cached page thumbnail on bookmark note change (#10303) 2023-04-14 07:53:05 +03:00
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
2023-04-13 20:43:04 +02:00
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).
2023-04-05 20:54:47 +02:00
hius07
483a005cc2
File browser: show Folder Menu on long-press on Home icon (#10298) 2023-04-05 08:24:41 +03:00
hius07
b01e1c5918
Reader: do not apply font size out of range (#10295) 2023-04-04 08:11:02 +03:00
hius07
34ab0d8ac6
Folder Menu: sign for Home folder (#10288) 2023-04-02 15:46:51 +02:00
hius07
827581ac72
readerbookmark: fix writing pdf annotation (#10287) 2023-04-02 10:31:43 +03:00
hius07
59a0139a60
File browser: add Folder Menu (#10275) 2023-03-31 19:35:27 +03:00
nairyo
983e083a0b
Center pdf manual zoom mode (#10246)
Center PDF content when its width is smaller than the screen

fix #9967
2023-03-31 17:29:16 +02:00
hius07
a3080b042a
BookInfo: add page information (#10255) 2023-03-31 12:59:11 +03:00
hius07
3a37d30ad6
Dispatcher: use translated labels for Zoom Mode actions (#10269) 2023-03-30 08:36:41 +03:00
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
2023-03-29 18:32:44 +02:00
hius07
4d26650ad6
Filesearcher: add search in book metadata (#10198) 2023-03-28 16:16:53 +03:00
hius07
df9c2bcb7f
History: fix book info buttons disable (#10244) 2023-03-26 21:11:19 +03:00
hius07
c6a7f083c9
readerstyletweak: update profiles on unregistering in dispatcher (#10247) 2023-03-26 21:10:39 +03:00
hius07
aedb713f82
Menu widget: cleanup (#10241) 2023-03-25 09:48:30 +02:00
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.
2023-03-23 20:28:38 +01:00
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.
2023-03-23 09:04:59 +01:00
poire-z
3006348585 PageBrowser: toggle page bookmark with long-press on thumbnail 2023-03-14 23:41:38 +01:00
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
2023-03-14 22:11:17 +01: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
hius07
a3d42ac344
Classic display mode: add popup file dialog buttons (#10185) 2023-03-07 22:24:42 +02:00
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.
2023-03-05 23:42:24 +01:00
Frans de Jonge
5fce41d7d9
[i18n] FileManagerMenu: remove stray newline from translated sting (#10174) 2023-03-05 21:10:03 +01:00
hius07
38bd768d5e
DocSettings: Move book metadata to preferred location (#10149) 2023-03-01 14:52:08 +02:00
NiLuJe
189739ac4c
ReaderFooter: Don't reset session marker on standby (#10167) 2023-02-28 18:06:43 +01:00
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"
2023-02-28 09:19:17 +02:00
hius07
5c9ba53353
History: update last book access time (#10156) 2023-02-23 19:23:30 +02:00
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".
2023-02-22 20:32:13 +01:00
hius07
54b3b5a8cc
ReaderHighlight: minor fixes (#10142)
* readerui: save highlight to pdf requires button press

* readerhighlight: fix select mode confirmbox icon
2023-02-19 20:49:09 +01:00
hius07
15605291c2
DocSettings: add support of centralized sdr storage (#10132) 2023-02-17 23:06:55 +02:00
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)
2023-02-17 00:37:30 +01: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
poire-z
2f0954fa71 Book style tweak: revamp sample tweak 2023-02-16 23:36:26 +01:00
hius07
91ff6ce2d8
ReaderBookmark: fix comparing positions (#10109) 2023-02-13 00:14:49 +01:00
Melik
881d8ed406 Fix spelling of filemanagerutil.genStatusButtonsRow 2023-02-11 21:49:23 +01:00
Melik
7d6da81233 Compact covermenu addn. to for loop, fix collections bug, further gimp genStatusButton to use upvalues 2023-02-11 21:49:23 +01:00
Melik
0e470aaed9 Remove leftover function, arg 2023-02-11 21:49:23 +01:00
Melik
d9b0785a96 Reset button gen to util, collections current file check
- filemanagerutil.resetDocumentSettings()'s doc_settings:close() -> doc_settings:flush()
- Remove current_status from filemanagerutil.getStatusButtonsRow() args, get it inside from file
- Move genStatusButton() inside filemanagerutil.getStatusButtonsRow()
- Move "Reset settings" button generation to filemanagerutil
- Rename "Reset settings" button to "Reset" and update popup box text
- Disable "Reset settings" for file if it's currently open in Collections (same as History)
2023-02-11 21:49:23 +01:00
Melik
fb7ec830c6 Create getStatusButtonsRow() for status buttons, hide row if history item deleted 2023-02-11 21:49:23 +01:00
Melik
31cfffc289 Pull genStatusButton() to filemanagerutil 2023-02-11 21:49:23 +01:00
Melik
502bb0ccbf Create genStatusButton() for buttons, use item.dim for deleted in history 2023-02-11 21:49:23 +01:00
Melik
9e7e68beb6 Shorten status button names 2023-02-11 21:49:23 +01:00
Melik
c0d0b36f98 Get rid of luacheck warning 2023-02-11 21:49:23 +01:00
Melik
1b2adfd201 Return to callback fudging, fix book info callback replacement 2023-02-11 21:49:23 +01:00
Melik
628cacf1e6 Disable status buttons for deleted files in history 2023-02-11 21:49:23 +01:00
Melik
77b110a987 Add 'Reset settings' button to collections 2023-02-11 21:49:23 +01:00
Melik
8642509f26 Move 'Put on hold' between reading & read 2023-02-11 21:49:23 +01:00
Melik
a9313dda1a Add buttons to collections 2023-02-11 21:49:23 +01:00
Melik
57849b3f7c Add buttons to history, use id for button-getting 2023-02-11 21:49:23 +01:00
Melik
086d4622e6 Add buttons to file manager, lay groundwork 2023-02-11 21:49:23 +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
Sargun Vohra
15fb73384f
EInk: Add a setting to toggle flashing on pages with images (#10049)
With minor code cleanups along the way ;).
2023-02-02 21:09:29 +01:00
NiLuJe
21210800c1
ReaderFooter/Header: Refine autorefresh repaint-or-not checks (#10045)
Use both a whitelist for targeted widget repaints, a blacklist for no repaint at all, and a fallback for a full in-order ReaderUI repaint when unsure.

Use a similar approach in ReaderHeader (i.e., prevent explicit refreshes while ReaderMenu is open).

Re #9979, re #9768
2023-02-02 00:29:23 +01:00
NiLuJe
7863a7ad70
Misc: Natural sorting refactor (#10023)
* Move natural sorting algo to a dedicated sort module to avoid code duplication
* Use a slightly more accurate algorithm, and speed it up by caching intermediary strings
* Calibre: Use natural sorting in metadata search (fix #10009)
2023-01-16 19:36:22 +01:00
NiLuJe
4732bc9aed ReaderView: Recompute page layout when toggling ReaderFooter in
non-reflowable documents.

The code only handled setups with "reclaim bar height" enabled (because
that's my usual workflow, har har), but would have broken in various
more or less obvious ways without it, depending on the exact layout/zoom
settings.
The previous attempts at handling the no-reclaim case were focused
on scroll mode, which is a bit of a nightmare. This approach should
deal as well/badly as the previous one in scroll mode, but actually
handle page mode properly ;).

Re #9979
2023-01-10 19:06:49 +01:00
hius07
d5a4ac14e1
ReaderUI: fix status and history (#9993) 2023-01-07 08:09:16 +02:00
NiLuJe
4ce0058e2d
ReaderLink: Minor logic simplification in onGoToPageLink (#9987)
Abort earlier if the nearest link is too far, instead of computing stuff and creating an object we'll never actually use.

Includes minor logging tweaks to vaguely related codepaths ;p.
2023-01-03 20:48:49 +01:00
zwim
f0b007bb31
Footer: avoid footer auto refresh over bottom menu (#9983) 2023-01-01 20:11:10 +01:00
poire-z
7448ad23e7 ReaderDogear: fix no y-offset after load with top status bar 2023-01-01 20:09:03 +01:00
zwim
ebaef61536
Make translateable: SystemStat, custom footer (#9945)
Fixes #9942.
2022-12-24 16:56:24 +01:00
NiLuJe
788ccac561
Input/Device: Refactor Gyro events handling (#9935)
* Get rid of the `canToggleGSensor` Device cap, it's now mandatory for `hasGSensor` devices. (This means Kindles can now toggle the gyro, fix #9136).
* This also means that `Device:toggleGSensor` is now implemented by `Generic`.
* Update the Screen & Gyro rotation constants to be clearer (c.f., https://github.com/koreader/koreader-base/pull/1568) (/!\ This might conceivably break some `rotation_map` user-patches).
* Input: Move the platform-specific gyro handling to Device implementations, and let Input only handle a single, custom protocol (`EV_MSC:MSC_GYRO`).
* Input: Refine the `rotation_map` disable method implemented in 43b021d37c. Instead of directly poking at the internal field, use a new method, `disableRotationMap` (/!\ Again, this might break some `rotation_map` user-patches).
* Input: Minor tweaks to event adjust hooks to make them more modular, allowing the Kobo implementation to build and use a single composite hook. API compatibility maintained with wrappers.
2022-12-21 15:50:39 +01:00
hius07
ee75abd4a0
Statistics: show correct number of notes in a book (#9928) 2022-12-18 18:04:00 +02:00
poire-z
b1b7773237
TouchMenu: tweak menu search (#9926)
- Cleanup search and animation codes, fix inconsistencies
  between animation/no-animation opening, and refreshes
  glitches on eInk.
- Show menu item on tap, with buttons to either open
  directly, or to walk there (removed earlier "Animation"
  checkbox, so the choice can be decided later).
- Move event handlers into ReaderMenu/FileManagerMenu.
- Avoid duplicated and confusing results from gestures
  and font-family submenus.
2022-12-18 01:25:41 +01:00
melyux
a53e9847fa
Footer: some menu items rewording (#9915)
Change footer status bar type setting label from 'Prefix' to 'Item style'.
2022-12-16 00:44:29 +01:00
melyux
6f39f6cb7b
Screensaver: exclude content when excluding cover, random image as fallback (#9912)
Exclude some screensaver option showing book content
(title, page image) when "Exclude this book cover" is checked. 
Random image as fallback, KOReader logo as 2nd-order fallback.
2022-12-15 00:30:38 +01:00
hius07
7719ad04f3
Reader: add open next file in folder to Dispatcher (#9916)
Closes https://www.mobileread.com/forums/showthread.php?t=350683.
2022-12-14 20:40:24 +01:00
NiLuJe
b16b215cbb ReaderHighlight: Appease newer versions of LuaCheck
Good to know: it now defaults to assuming that function arguments
prefixed with an underscore would be unused, which is... nice in theory ;).
2022-12-13 00:17:25 +01:00
Roygbyte
3e49cf9a18
ReaderLink: allow buttons to be added to the External link dialog (#9746)
So plugins can register and advertize themselves
as handlers of external links (ie. Wallabag).
2022-12-11 16:52:40 +01:00
Frans de Jonge
e1fe897c9b
[i18n] Add a couple of explanatory comments for translators (#9878) 2022-12-11 10:08:46 +01:00
hius07
c53dd55b16
ReaderHighlight: new Select mode icon (#9869) 2022-12-11 09:55:47 +01:00
weijiuqiao
49d8ec2f4f
Cloudsync: dropbox token re-generation (#9862) 2022-12-11 09:54:58 +01:00
hius07
05cd59ebe5
ReaderBookmark: indicate current page with dimmed page numbers after current (#9872) 2022-12-09 09:08:14 +01:00
Frans de Jonge
e58a12ba04
TouchMenu: Search menu to search the menu (#9876)
Fixes #9800.
2022-12-06 22:02:21 +01:00
zwim
192a243b4d Add datetime.lua
Move date and time related functions from util.lua
(and the statistics plugin) to a new datetime.lua.
2022-12-06 17:36:08 +01:00
zwim
d1cd2a1c8d
Restart KOReader: add a ConfirmBox instead of a plain InfoMessage (#9853) 2022-12-03 21:29:13 +01:00
Steady Quad
fa9f0acf5e
cloudstorage: Fix directory listing for some WebDAV servers (#9847)
(sub)folders on some WebDAV servers are not listed in cloudstorage due to strict xml element matching of <d:collection> elements.
2022-12-02 23:47:16 +01:00
hius07
cd56dd2edf
ReaderHighlight: pdf multi-page highlights (#9850) 2022-12-02 20:22:27 +02:00
melyux
cc53ceb039
History: remember status filter, show filtered count in title (#9822) 2022-12-02 16:56:00 +01:00
Frans de Jonge
84be6fc226
[i18n] Fix 'Choose new folder to set as home?' can't be translated (#9841)
Reported in <https://www.mobileread.com/forums/showthread.php?p=4276962#post4276962>.
2022-11-27 21:55:26 +01:00
hius07
c35140e8d2
ReaderHighlight: new icon in select mode ConfirmBox (#9830) 2022-11-25 11:18:54 +02:00
hius07
90f6dd178e
CloudStorage: add DropBox starting folder (#9821) 2022-11-22 14:53:10 +02:00
hius07
5b889a0145
Reader style tweaks: register in Dispatcher manually (#9816)
Style tweaks can be applied with a gesture or added to a profile.
2022-11-22 13:46:44 +01:00
zwim
486d7071c7
[StatusBar] Allow status bars to be repainted if they are not covered (#9768) 2022-11-20 05:33:44 +01:00
hius07
d95c692c78
ReaderHighlight: add abort select mode (#9786) 2022-11-18 20:17:25 +01:00
weijiuqiao
e481e60aa1 Syncservice: fix not updating services after adding new ones 2022-11-16 22:51:38 +01:00
NiLuJe
df890105e4 ReaderMenu: Use a dedicated handler for the Menu key
Piggybacking on the touch gesture handlers implied that the gesture
filter (tap and/or swipe) was still applied, which made no sense.

Also, stop the weird Event roundtrip for events we're actually the only
ones to handle, just call the handler ourselves directly.

Fix #9792
2022-11-16 22:11:19 +01:00
hius07
06cec98d09
Filemanagerutil: let abbreviate manage extra slash (#9785) 2022-11-14 02:20:26 +01:00
hius07
71c65d18f1
Page turns: add backward tap zone width setting (#9772) 2022-11-12 08:40:31 +02:00
poire-z
1fa706a2c5
Fix page stats messed up after rerendering (#9775)
Fix regression introduced by 48eb0231 #9651: on re-rerendering, the new pages count didn't reach the Statistics plugin.
So, if you change font size or margins, the stats for the page read since then were badly accounted, until a change of book or restart... I noticed that in Book map, strange nobody else did over the last 2.5 weeks.
2022-11-11 21:43:27 +01:00
weijiuqiao
8500fdd519
Cloud-based sync for 2 plugins: reading statistics and vocabulary builder (#9709)
This commit adds cross-device sync ability for two plugins: reading statistics and vocabulary builder. It relies on user setting up a Cloud server (DropBox and WebDAV but not FTP though) and designating a path. Behind the curtains sqlite databases are being passed around and updated.

UI-wise, for the statistics plugin, two new menu items Synchronize now and Cloud sync to set it up (might not be the best wording) are added. As for vocabulary builder, a similar Cloud sync button is added to the menu and a shortcut icon button to Synchronize now is pinned at the bottom corner.

CloudStorage new features: WebDAV creating folders and uploading files. And a new widget-like sync server chooser. In the end I decided not to add automatic sync, as the SQL commands part seem a bit much.
2022-11-11 15:53:06 +01:00
hius07
4f3000e882
ReaderHighlight: fix ending fragment check (#9769) 2022-11-10 18:13:18 +02:00
hius07
c3ed51aded
ReaderHighlight: set default long-press action with a gesture (#9723) 2022-11-02 13:58:12 -04:00
NiLuJe
925fd647dc InputContainer/FocusManager: Simplify key_events clearing on unplug
Thanks to @poire-z for the idea, it's indeed much nicer this way ;).
2022-11-02 03:48:39 +01:00
NiLuJe
09498d4bbb ReaderUI: Refresh key_events handlers on keyboard hotplug 2022-11-02 03:48:39 +01:00
NiLuJe
e0bfebb0b5 FileManager: Refresh key_events handlers on keyboard hotplug 2022-11-02 03:48:39 +01:00
NiLuJe
8cba303b96 ReaderPanning: Don't crash in the key event handler.
I'm unclear on where this is supposed to do anything, though.
But at least it no longer crashes, so, yay?
2022-11-02 03:48:39 +01:00
NiLuJe
25dce4d1b5 WebDAV: Fix a warning with the latest LuaCheck version
(error-prone negation)
2022-11-02 03:48:39 +01:00
NiLuJe
1e24a1c7a3 ReaderUI: Properly neuter gesture handling from InputContainer modules
None[1] of them actually rely on their own onGesture handler, they
all register their own stuff to ReaderUI's.
Hotfix #9710 revealed that the way this was handled didn't exactly
work as expected ;).

The only thing that consumes ges_events is InputContainer's onGesture
method. All these modules *extend* InputContainer, but none of them
*implement* a custom onGesture, so self.onGesture = nil was just a NOP,
they always access InputContainer's method via inheritance.
If we actively want to neuter it, we *have* to implement it in that
module (with a NOP).

[1] The exception being ReaderZooming, but that only when in flip mode.
2022-11-02 03:48:39 +01:00
yparitcher
4d8e2f0ea1 ges_events must be a table
regression in #9691 b523c2e8b9
2022-10-29 23:30:16 -04:00
NiLuJe
b523c2e8b9 InputContainer: Fall cleanup ;).
Get rid of the doc & seqtext fields, as they are not actually used (nor
are they particularly useful, the event handler's name should be pretty
self-explanatory).

Also, tweak the key_events documentation to highlight the quirks of the
API, especially as far as array nesting is involved...

Random drive-by cleanup of the declarations of key_events & ges_events
to re-use the existing instance object (now that we know they're sane
;p) for tables with a single member (less GC pressure).
2022-10-29 22:55:20 +02:00
hius07
a8ff3a6571 readerzoomin: add zoom mode translation, simplify zoom mode validation 2022-10-29 17:48:21 +02:00
hius07
0919c4ef17 readerkoptlistener: simplify zoom mode validation 2022-10-29 17:48:21 +02:00
weijiuqiao
e8cd2ba498
WebDAV: fix bugs when start folder starts with "/" (#9688) 2022-10-29 17:45:52 +02:00
zwim
d7c63edca6
Random optimizations (#9657) 2022-10-28 07:51:27 +02:00
poire-z
48eb02318d
Dispatcher: avoid multiple cre rerenderings when many settings changed (#9651)
When a gesture/profile was updating multiple cre settings,
each setting handler would emit UpdatePos which each would
force a re-rendering.
When this might be happening, postpone the rerendering
until all are set.
Needs some bit of refactoring to the events at play:
introduce "DocumentRerendered" event, and use it where
we used "UpdatePos" or "UpdateToc" to mean exactly that.
2022-10-25 13:16:01 +02:00
hius07
d1abbbfdd8
Document settings submenu: add Save as default (#9643) 2022-10-25 12:34:23 +02:00
weijiuqiao
edf7cc9a61
Vocabulary builder: support extracting context from pdfs (#9622)
Move getSelectedWordContext(), now document specific,
from ReaderHighlight into each document module.
2022-10-25 12:23:18 +02:00
NiLuJe
da65ac8b02
Cleanup various varargs shenanigans (#9624)
* Iterate over varargs directly via select if possible
* Use table.pack otherwise (https://github.com/koreader/koreader-base/pull/1535).
* This allows us to simplify a few Logger calls, as logger now handles nil values.
2022-10-12 19:59:48 +02:00
hius07
a728e3b5fa
ReaderStatus: save status summary (#9619) 2022-10-10 17:52:47 -04:00
zwim
4969811c08
Optimization: Use constant folding for divisions not a power of two (#9609) 2022-10-10 22:21:27 +02:00
NiLuJe
a62f076e56 DictQuickLookup: The window_list array needs to be a static class member
Also, make sure references are actually dropped,
no matter how the widget is closed, by relying on onCloseWidget ;).

Enable the "long-press-on-close" trick on the actual Close button,
too, instead of only on the title bar's cross.

Fix: https://github.com/koreader/koreader/pull/9586#issuecomment-1272332275
2022-10-09 05:30:28 +02:00
NiLuJe
c0dffe2012
Kobo: Add a debug option to turn the charging LED on PM entry failure (#9601)
This should be fairly unintrusive, but still noticeable enough without having to watch the battery gauge like a hawk, or resort to actual monitoring via kernel logs and/or usb meter and/or multimeter...
2022-10-07 17:33:57 +02:00
NiLuJe
eef938996f MultiDialog: Fix an extremely nasty API misuse
Stuff was poking at the class object, not the instance's :s.

Fix #9599
2022-10-06 19:28:26 +02:00
NiLuJe
fadee1f5dc
Clarify our OOP semantics across the codebase (#9586)
Basically:

* Use `extend` for class definitions
* Use `new` for object instantiations

That includes some minor code cleanups along the way:

* Updated `Widget`'s docs to make the semantics clearer.
* Removed `should_restrict_JIT` (it's been dead code since https://github.com/koreader/android-luajit-launcher/pull/283)
* Minor refactoring of LuaSettings/LuaData/LuaDefaults/DocSettings to behave (mostly, they are instantiated via `open` instead of `new`) like everything else and handle inheritance properly (i.e., DocSettings is now a proper LuaSettings subclass).
* Default to `WidgetContainer` instead of `InputContainer` for stuff that doesn't actually setup key/gesture events.
* Ditto for explicit `*Listener` only classes, make sure they're based on `EventListener` instead of something uselessly fancier.
* Unless absolutely necessary, do not store references in class objects, ever; only values. Instead, always store references in instances, to avoid both sneaky inheritance issues, and sneaky GC pinning of stale references.
  * ReaderUI: Fix one such issue with its `active_widgets` array, with critical implications, as it essentially pinned *all* of ReaderUI's modules, including their reference to the `Document` instance (i.e., that was a big-ass leak).
* Terminal: Make sure the shell is killed on plugin teardown.
* InputText: Fix Home/End/Del physical keys to behave sensibly.
* InputContainer/WidgetContainer: If necessary, compute self.dimen at paintTo time (previously, only InputContainers did, which might have had something to do with random widgets unconcerned about input using it as a baseclass instead of WidgetContainer...).
* OverlapGroup: Compute self.dimen at *init* time, because for some reason it needs to do that, but do it directly in OverlapGroup instead of going through a weird WidgetContainer method that it was the sole user of.
* ReaderCropping: Under no circumstances should a Document instance member (here, self.bbox) risk being `nil`ed!
* Kobo: Minor code cleanups.
2022-10-06 02:14:48 +02:00
hius07
1ea7e16f3e
Cloud storage: add Dropbox short-lived tokens (#9496) 2022-10-04 12:33:53 -04:00
hius07
c5505879c3
ConfigDialog: fix bug in DoubleSpinWidget default values (#9580) 2022-10-04 07:44:55 -04:00
hius07
b0eb0ce0e1
FileManager: add Select button to the file long-press menu (#9571) 2022-10-04 07:44:17 -04:00
poire-z
3bd27c3a76 ReaderFont: add "Font-family fonts" submenu
Allow associating a font to each of the generic
font-family names.

Bump crengine:
- CSS parsing: accept (and ignore) namesspaces
- isImage(): more checks for <object> as it can have inner content
- getFontFileNameAndFaceIndex(): returns if font has math support
- getFontFileNameAndFaceIndex(): returns if font has emojis
- CSS/Fonts: add support for font-family to font name mapping
2022-10-03 23:27:44 +02:00
poire-z
137b39416f ReaderLink:showAsFootnotePopup(): remove some logger.info() 2022-10-03 23:27:44 +02:00
NiLuJe
9bf19d1bb3
Assorted bag'o tweaks & fixes (#9569)
* UIManager: Support more specialized update modes for corner-cases:
  * A2, which we'll use for the VirtualKeyboards keys (they'd... inadvertently switched to UI with the highlight refactor).
  * NO_MERGE variants of ui & partial (for sunxi). Use `[ui]` in ReaderHighlight's popup, because of a Sage kernel bug that could otherwise make it translucent, sometimes completely so (*sigh*).
* UIManager: Assorted code cleanups & simplifications.
* Logger & dbg: Unify logging style, and code cleanups.
* SDL: Unbreak suspend/resume outside of the emulator (fix #9567).
* NetworkMgr: Cache the network status, and allow it to be queried. (Used by AutoSuspend to avoid repeatedly poking the system when computing the standby schedule delay).
* OneTimeMigration: Don't forget about `NETWORK_PROXY` & `STARDICT_DATA_DIR` when migrating `defaults.persistent.lua` (fix #9573)
* WakeupMgr: Workaround an apparent limitation of the RTC found on i.MX5 Kobo devices, where setting a wakealarm further than UINT16_MAX seconds in the future would apparently overflow and wraparound... (fix #8039, many thanks to @yfede for the extensive deep-dive and for actually accurately pinpointing the issue!).
* Kobo: Handle standby transitions at full CPU clock speeds, in order to limit the latency hit.
* UIManager: Properly quit on reboot & exit. This ensures our exit code is preserved, as we exit on our own terms (instead of being killed by the init system). This is important on platforms where exit codes are semantically meaningful (e.g., Kobo).
* UIManager: Speaking of reboot & exit, make sure the Screensaver shows in all circumstances (e.g., autoshutdown, re: #9542)), and that there aren't any extraneous refreshes triggered. (Additionally, fix a minor regression since #9448 about tracking this very transient state on Kobo & Cervantes).
* Kindle: ID the upcoming Scribe.
* Bump base (https://github.com/koreader/koreader-base/pull/1524)
2022-10-02 03:01:49 +02:00
NiLuJe
4d48b6e2fe
Misc: Use the ^ operator instead of math.pow (#9550)
And some minor code simplifications, thanks to @zwim ;).
2022-09-28 01:11:34 +02:00
NiLuJe
62059f8d68
Misc: Get rid of the legacy defaults.lua globals (#9546)
* This removes support for the following deprecated constants: `DTAP_ZONE_FLIPPING`, `DTAP_ZONE_BOOKMARK`, `DCREREADER_CONFIG_DEFAULT_FONT_GAMMA`
* The "Advanced settings" panel now highlights modified values in bold (think about:config in Firefox ;)).
* LuaData: Isolate global table lookup shenanigans, and fix a few issues in unused-in-prod codepaths.
* CodeStyle: Require module locals for Lua/C modules, too.
* ScreenSaver: Actually garbage collect our widget on close (ScreenSaver itself is not an instantiated object).
* DateTimeWidget: Code cleanups to ensure child widgets can be GC'ed.
2022-09-28 01:10:50 +02:00
NiLuJe
b0d8919399
ImageViewer: Followup to #9529 (#9544)
* ImageViewer: Minor code cleanups
* GestureDetector: Fix the `distance` field of `two_finger_pan` & `two_finger_swipe` gestures so that it's no longer the double of the actual distance traveled. Get rid of existing workarounds throughout the codebase that had to deal with this quirk.
2022-09-21 23:26:22 +02:00
poire-z
a8c81a90c3
ReaderDict: fix use of dicts with ifo with DOS line endings (#9536)
Fixed in upstream sdcv, but we need to also do it in
our parsing of .ifo and picking out dict name.
Also includes minor bump of base/sdcv.
2022-09-21 00:26:10 +02:00
hius07
45e4f38c41
CloudStorage: remove cloudmgr (#9532)
Use downloadmgr instead.
2022-09-20 11:54:57 +02:00
NiLuJe
83a2965d6b
Misc: Unify error logging on network errors (#9523)
Making sure we get the relevant information in the logs, and that the UI feedback (if any), is meaningful and readable.
2022-09-17 00:08:00 +02:00
NiLuJe
2fe2515ace
FontList: Always use the binary cache format (#9519)
Since I never actually needed to look into that data ever until today, let's just get rid of the weird debug-specific behavior.

Instead, just add a dedicated "Developer options" entry that will dump it on demand (and it'll be sorted to boot, which makes it 500% more usable).

Plus, since yesterday's change, the cache format switch between debug or not miiiight actually be crashy, so re-trigger the migration ;p.

* Includes a couple of noteworthy base bumps:

https://github.com/koreader/koreader-base/pull/1516 (update to sdcv 0.5.4 + fixes pending upstream)
https://github.com/koreader/koreader-base/pull/1517 (fix ffiUtil.orderedPairs with keys of mixed types)
2022-09-15 04:42:13 +02:00
NiLuJe
13e8213e0a
A random assortment of fixes (#9513)
* Android: Make sure sdcv can find the STL
* DocCache: Be less greedy when serializing to disk, and only do that for the *current* document ;).
* CanvasContext: Explicitly document API quirks.
* Fontlist: Switch the on-disk Persist format to zstd (it's ever so slightly faster).
* Bump base for https://github.com/koreader/koreader-base/pull/1515 (fix #9506)
2022-09-14 03:49:50 +02:00
hius07
56388aa491
TextViewer: add Find (#9507) 2022-09-13 17:09:49 -04:00
poire-z
76a7d83079 CRE/ImageViewer: get scaled blitbuffer when long-press on SVG
Get a Lua userdata wrapping a crengine LVSvgImageSource object
when long-press on a SVG image, and have crengine/LunaSVG render
it smoothly scaled to the requested size by ImageViewer.
2022-09-12 00:40:08 +02:00
poire-z
087f605fd9 Allow F5 key to reload document 2022-09-12 00:40:08 +02:00
zwim
d972b7fcfa
[core] Remove a bunch of superflous semicolons (#9449) 2022-09-08 21:52:06 +02:00
NiLuJe
8e1bb9bafc
GestureDetector: Full refactor for almost-sane(TM) MT gesture handling (#9463)
Should hopefully make two-contact gestures *much* more reliable, among other things.

See the PR for all the details ;).
2022-09-04 02:38:27 +02:00
hius07
f67469bab4
Highlight: add note marker (#9395) 2022-08-03 09:51:57 -04:00
hius07
460d42293a
PathChooser: add creating folder (#9354) 2022-07-27 12:02:37 -04:00
poire-z
5e2ed5ae2a
bump crengine: monospace and fallback fonts tweaks (#9343)
Includes:
- Text: fix possible overflow with "white-space: pre"
- Fonts: getFontFileNameAndFaceIndex(): return family type
- Fonts: account for _bias in Font hash
- epub.css, fb2.css: remove hardcoded monospace font names
- Fonts: allow scaling monospace fonts
- Fonts: allow adjusting fallback font sizes to x-height
- HTML parser: trust xml encoding before html charset

In our list of fonts, show a "M" indicator alongside
monospace fonts, and allow long-press to select the one
to be use for "font-family: monospace".
Add 2 options to Font settings, to scale monospace fonts
by a percentage, and to adjust fallback fonts to their
x-height.
2022-07-18 01:16:51 +02:00
zwim
22fe3933c3
[fix, SDL] Time: fix crash when scrolling in continuous mode (#9314)
Introduced with #8999.

Fixes #9311.
2022-07-09 22:47:10 +02:00
poire-z
10a6ffd927 Style tweaks: fix typos and global tweak conflict
Minor logic fix: allow global_conflicts_with to be not only
a function, but also a string or a table, as documented.
2022-07-08 21:18:42 +02:00
poire-z
6fb266cb71 Style tweaks: handle conflicting/redundant tweaks
Disable redundant or incompatible tweaks when enabling some.
This makes the menu more dynamic to show what's impacted,
save some re-renderings, and may avoid the user trying
combinations that would have no effect.
2022-07-07 00:32:07 +02:00
poire-z
e4eb1c61d1 Footnote popup: allow using book font as popup font
Also move footnote popup settings into a submenu.
2022-06-25 19:53:50 +02:00
poire-z
38bd2b4c46 ReaderRolling: fix marker sometimes not removed
Noticed when jump to a footnote and quickly going back.
2022-06-25 19:53:50 +02:00
Martín Fernández
b7a27a3db3
Fullscreen refactor (#9237)
Commonize fullscreen code across different devices.

Add fullscreen toggle on SDL desktop targets. 
Expose the toggle to the dispatcher and map it to F11.

Hide touchmenu when resizing.
2022-06-24 23:19:38 +02:00
weijiuqiao
cafbf36bb2
Vocabulary builder: store word context, other tweaks and fixes (#9195)
Add a copy button and save word context (off by default), shown
via the three-dot menu of word entries.
Also some db refactoring and minor UI improvements:
- a dedicated book title table in order to shrink db size by storing
  references to title names instead of repeated actual strings,
- alignment of different forms of the "more" button and possible
 clipped words in translations.
- fix plugin name so it can be disabled
2022-06-12 21:34:17 +02:00
zwim
e8597c2e0c
Footer: update on network disconnect (#9185) 2022-06-11 22:03:51 +02:00
poire-z
b9724f1e93 Text highlighting: extend to include punctuations
When selected text seems to be a "sentence segment"
(that is, when there are punctuations around start
AND end), extend the selection to include the relevant
punctuation.
Do this only when saving highlights and for translation
(but not when dict or wikipedia lookups, or search).
2022-06-11 20:58:52 +02:00
poire-z
141fa98a32 bump crengine: text selection tweaks and helpers
Includes:
- lvtext: fix m_kerning_mode type
- XML: let 'gb2312' (Chinese) encoding be known
- Add ldomXPointer::getChar()
- LVDocView::getNodeByPoint(): tweak for text selection
- Fonts: allow fetching the list of embedded fonts
cre.cpp:
- getTextFromPositions(): use getNodeByPoint(forTextSelection=true)
  to allow panning in margins and get the nearest text instead
  of nothing.
- add extendXPointersToSentenceSegment() to allow extending some
  xpointer range to include punctuations at start or end (with
  for now a quite rudimentory implementation).
- add getEmbeddedFontList() to allow fetching the list of
  embedded fonts in the current EPUB book.
2022-06-11 20:58:52 +02:00
NiLuJe
dcb11c2542
Make luacheck >= 0.26 happy (#9174)
Re: https://github.com/koreader/koreader-base/pull/1487
2022-06-11 19:06:06 +02:00
Martín Fdez
d644b1a851 android: update doShareText signature 2022-06-10 22:47:18 +02:00
NiLuJe
73b2b38954
AutoSuspend: Make sure we send a LeaveStandby event ASAP (#9173)
Even in corner cases where we're woken up without user input (e.g., rtc alarm).

(Followup to #9124)
2022-06-07 00:22:22 +02:00
poire-z
c825d50c8f CRE: add "CJK width scaling" option
The setting is handled like all other bottom menu options
but, as it's really not useful and its target audience is
very limited, make it not shown in the bottom menu, but
available via another button in the (also quite not useful)
Word Expansion fine tuning widget.
2022-06-06 01:08:59 +02:00
poire-z
f29ee8475e Style tweaks: add "Tailor widths and text-indent for CJK"
Also add a timeout to the "Changed language for
typography rules" InfoMessages.
2022-06-06 01:08:59 +02:00
weijiuqiao
e1b137339c
[feat, plugin] Vocabulary builder (#9132)
Made the old dictionary lookup history into a flashcard-ish vocabulary builder.
2022-05-31 22:11:35 +02:00
zwim
5a033f1221
DateTimeWidget: don't make ":" and "/" translatable (#9145)
* And the ellipsis
2022-05-29 22:32:16 +02:00
NiLuJe
ae5b2d68ca
AutoSuspend: Don't send LeaveStandby events from a zombie plugin instance (#9124)
Long story short: the LeaveStandby event is sent via `tickAfterNext`, so if we tear down the plugin right after calling it (in this case, that means that the very input event that wakes the device up from suspend is one that kills ReaderUI or FileManager), what's in UIManager's task queue isn't the actual function, but the anonymous nextTick wrapper constructed by `tickAfterNext` (c.f., 
https://github.com/koreader/koreader/issues/9112#issuecomment-1133999385).

Tweak `UIManager:tickAfterNext` to return a reference to said wrapper, so that we can store it and unschedule that one, too, in `AutoSuspend:onCloseWidget`.

Fix #9112 (many thanks to [@boredhominid](https://github.com/boredhominid) for his help in finding a repro for this ;)).
Re: #8638, as the extra debugging facilities (i.e., ebb81b9845) added during testing might help pinpoint the root issue for that one, too.

Also includes a minor simplification to `UIManager:_checkTasks`, and various other task queue related codepaths (e.g., `WakeupMgr`) ;).
2022-05-25 23:36:41 +02:00
hius07
e336983fd2
Cloudstorage WebDAV: more fix slash in server address (#9128)
Honor server addresses with or without trailing slash.
Regression since #9061. Closes #9125.
2022-05-25 17:02:46 +02:00
zwim
d5d5867d4e
DoubleSpinWidget, SpinWidget: add units, make usage more consistent (#9046) 2022-05-24 00:25:50 +02:00
yparitcher
8f316b1e8c
Merge discardEvents & inhibitInput (#9065)
Rename `discardEvents` to `inhibitInputUntil`
only discard Input events
2022-05-23 13:52:52 +02:00
yparitcher
a97dbb05ed
Page turn animations: add to dispatcher (#9123)
xref: https://www.mobileread.com/forums/showthread.php?p=4224443&postcount=1119
2022-05-23 09:19:47 +02:00
hius07
f2c3fd54a1
filemanagershortcuts: fix adding the first shortcut (#9107)
Closes #9105.
2022-05-18 10:48:47 +02:00
zwim
84dd58f9df
Power-savings in readerdevicestatus: Schedule on full minute and fix multiple scheduling. (#9032) 2022-05-09 18:23:50 +02:00
NiLuJe
60b043ebe9
ReaderFooter: Refresh the footer on frontlight state changes issued by the frontlight widget (#9084)
c.f, https://www.mobileread.com/forums/showpost.php?p=4220159&postcount=7
2022-05-09 08:36:13 +02:00
poire-z
f286787ff5 ReaderPageMap: fix page labels in 2-columns mode
Page labels on the right page could have some bad y position
(they were never above the last page label on the left page)
2022-05-06 23:53:45 +02:00
Philip Chan
d6ff983243
Show TitleBar left and right buttons on non-touch devices (#9041)
Titlebar button navigation in menu, including ListMenu and MosaicMenu in FileManager, History, Favourites and Shortcuts.
Hide show password checkbox in non-touch devices
2022-05-06 10:44:25 +02:00
zwim
9b9cfe29a4
[feat] Replace TimeVal (RIP) with time, fixed point time seconds (#8999) 2022-05-05 21:00:22 +02:00
yparitcher
54ead5fc88 Page turn animations
Kindle PW5 (MTK) with hardware support
Currently only in Crengine
2022-05-05 10:48:16 -04:00
hius07
9de0df81da
Cloudstorage WebDAV: fix leading slash for root folder (#9061) 2022-05-03 09:35:25 +03:00
NiLuJe
86c35ad066
A host of low power states related tweaks (#9036)
* Disable all non power management related input during suspend. (This prevents wonky touch events from being tripped when closing a sleep cover on an already-in-suspend device, among other things).
* Kobo: Use our WakeupMgr instance, not the class.
* WakupMgr: split `removeTask` in two: 
* `removeTask`, which *only* takes a queue index as input, and only removes a single task. Greatly simplifies the function (i.e., it's just a `table.remove`).
* `removeTasks`, which takes an epoch or a cb ref, and removes *every* task that matches.
* Both of these will also *always* re-schedule the next task (if any) on exit, since we can have multiple WakeupMgr tasks queued, but we can only have a single RTC wake alarm set ;).
* `wakeupAction` now takes a `proximity` argument, which it passes on to its `validateWakeupAlarmByProximity` call, allowing call sites to avoir having to duplicate that call themselves when they want to use a custom proximity window.
* `wakeupAction` now re-schedules the next task (if any) on exit.
* Simplify `Kobo:checkUnexpectedWakeup`, by removing the duplicate `WakerupMgr:validateWakeupAlarmByProximity` call, now that we can pass a proximity window to `WakeuoMgr:wakeupAction`.
* The various network activity timeouts are now halved when autostandby is enabled.
* Autostandby: get rid of the dummy deadline_guard task, as it's no longer necessary since #9009.
* UIManager: The previous change allows us to simplify `getNextTaskTimes` into a simpler `getNextTaskTime` variant, getting rid of a table & a loop.
* ReaderFooter & ReaderHeader: Make sure we only perform a single refresh when exiting standby.
* Kobo: Rewrite sysfs writes to use ANSI C via FFI instead of stdio via Lua, as it obscured some common error cases (e.g., EBUSY on /sys/power/state).
* Kobo: Simplify `suspend`, now that we have sane error handling in sysfs writes.
* Kobo.powerd: Change `isCharging` & `isAuxCharging` behavior to match the behavior of the NTX ioctl (i.e., Charging == Plugged-in). This has the added benefit of making the AutoSuspend checks behave sensibly in the "fully-charged but still plugged in" scenario (because being plugged in is enough to break PM on `!canPowerSaveWhileCharging` devices).
* AutoSuspend: Disable our `AllowStandby` handler when auto standby is disabled, so as to not interfere with other modules using `UIManager:allowStandby` (fix #9038).
* PowerD: Allow platforms to implement `isCharged`, indicating that the battery is full while still plugged in to a power source (battery icon becomes a power plug icon).
* Kobo.powerd: Implement `isCharged`, and kill charging LEDs once battery is full.
* Kindle.powerd: Implement `isCharged` on post-Wario devices. (`isCharging` is still true in that state, as it ought to).
2022-05-01 23:41:08 +02:00
hius07
74d0d22a15 readerhighlight: keep highlight for default action 'Translate' 2022-04-17 09:37:29 +02:00
zwim
71f6bd8ba5
ReaderFooter: Make setDirty happy (#9005)
Don't pass a non-window-level widget.
Painting is handled explicitly via widgetRepaint, so passing a widget to setDirty was just plain wrong anyway ;).
2022-04-16 18:57:37 +02:00
Philip Chan
77accf6546
Non-touch: highlight movement improvement and enable page crop (#8947) 2022-04-14 08:59:36 +02:00
poire-z
814f42cce0 UIManager:discardEvents(): use accurate "now"
Instead of UIManager possibly staled _now, which could have
no effect after a long ReaderRolling re-rendering.
Also lower the delay after such ReaderRolling re-rendering,
so we can change settings quicker when comparing renderings.
2022-04-11 22:42:56 +02:00
zwim
eaa6e77398
Status bar: fix battery display (threshold with aux battery) (#8959) 2022-04-08 12:20:25 +02:00
zwim
d820dd84d6
Readerview: fix checkAutoSaveSettings() with enabled standby (#8961) 2022-04-03 18:20:55 +02:00
zwim
158f4be724
Autosuspend: add autostandby (#8815)
Allows the device to go into standby (if available in `/sys/power/state`) to save power.
Adds an entry in the device menu to tune the timeout for standby.
(Shows total standby- and suspend-time in system statistics.)
2022-03-29 22:59:10 +02:00
lennonhill
eb34fbb818
PDF: align page view with target when following internal link (#8907) 2022-03-16 23:22:56 +01:00
zwim
8f3e9a5a61
UserHyph: Scrub and sort user dict (#8863) 2022-03-16 21:30:58 +01:00
Philip Chan
9f755dd202
[NT] Hide "Start content selection" and "Select on text" menu item on touch devices (#8914)
only center hold_pos and highlight indicator position with crengine document which has stable screen position
2022-03-16 20:00:14 +01:00
Frans de Jonge
0fe3a9d19c
[i18n] Add context to book status filter options (#8906)
Fixes #8903.
2022-03-15 16:16:04 +01:00
NiLuJe
217a73f3c0
Initial Kindle PW5 support (#8856)
* Rejig frontlight warmth API to more closely match the existing API, and, hopefully, clarify some of its quirks, and reduce boilerplate and duplicate code in platform implementations.
* Tweak Kindle:setDateTime to prefer using the platform's custom script, as in interacts better with the stock UI. And make the fallbacks handle old busybox versions better.
* Add Kindle PW5 support ;).
* Add warmth support to the Kindle platform.
* Random TextBoxWidget cleanups: make sure we immediately free destroyed instances.
* FrontLightWidget: Refactor to make it slightly less obnoxious to grok and update; i.e., separate layout from update, and properly separate brightness from warmth handling. Move to simpler widgets instead of reinventing the wheel.
* TextBoxWidgets: Implement `setText` to match TextWidget's API, as some callers may be using the two interchangeably (i.e., Button).
* NaturalLightWidget: Make sure we pass a string to InputText
* InputText: Add debug guards to catch bad callers not passing strings ;).
2022-03-14 19:56:18 +01:00