Commit Graph

2311 Commits (4e5def4282ebafe4eb0d089ecdd6a4af5448f96e)

Author SHA1 Message Date
NiLuJe 4e5def4282
Tame a few tests that relied on `pairs` being somewhat deterministic (#6371)
* Mangle stupid defaults test so that it compares tables, and not a non-deterministic string representation of one.

It's still extremely dumb and annoying to update. (i.e., feel free to kill it with fire in a subsequent PR, I think everybody would cheer).

* Rewrite DepGraph to be deterministic

i.e., fully array based, no more hashes, which means no more pairs randomly re-ordering stuff.

Insertion order is now preserved.

Pretty sure a couple of bugs have been fixed and/or added along the way
;p.

* Resync frontend/apps/filemanager/lib/md.lua w/ upstream

And use orderedPairs in the attribute parsing code, just to make that stupid test happy.
4 years ago
yparitcher 70f89c4df1
ReaderGesture: cleanup (#6292)
convert all gesture actions to use events for better modularity
add network event handlers and device event handlers
4 years ago
Martín Fdez a376a52c3a easier user font paths with Device.home_dir 4 years ago
NiLuJe 509ee7bb86
Allow locking the gyro to the current screen mode (#6347)
* Allow locking the gyro to the current screen mode (i.e., orientation).
* Tweak the "sticky rota" option to work both ways
* More rotation constant usage instead of magic numbers
4 years ago
yparitcher f7d538b108
Landscape FM / Refactor rotation (#6309)
* landscape FM / Refactor rotation

refactor and simplify the orientation handling code. the user generally cares about the rotation (what direction the device is facing) and not about if koreader is displaying in portrait or landscape mode

* bump base

update luasocket, libjpeg-turbo, curl
add logging to evernote-sdk-lua
update framebuffer for proper rotation
4 years ago
Frans de Jonge 09c654c7ec
[chore] Simplify OPDSBrowser http.request handling (#6334)
Cf. <https://github.com/koreader/koreader/pull/6307>.
4 years ago
Frans de Jonge bb376fb16b
[feat] Add text/html to OPDSBrowser (#6335) 4 years ago
Frans de Jonge 4a3710b6d3
[i18n] Add support for fledgling Hebrew translation (#6333)
See <https://hosted.weblate.org/languages/he/koreader/> if you'd like to contribute.
4 years ago
Frans de Jonge 7a37accdcc
[UX] Add left to close to ConfigDialog for hasFewKeys (#6318)
Follow-up to <https://github.com/koreader/koreader/pull/6195>.

Part of <https://github.com/koreader/koreader/issues/4029>.
4 years ago
Frans de Jonge 060ee98048
[feat] FocusManager: wrap around horizontally (#6315)
There doesn't seem to be a reason not to, but it could be limited to `Device:hasFewKeys()` if desired.

Cf. <https://github.com/koreader/koreader/pull/6312#issuecomment-650207697>.
4 years ago
Martín Fernández 32207523b0
emulator: add fake network manager (#6314) 4 years ago
poire-z 71744688c7 Style tweaks: use 0.8rem instead of 80% for in-page footnotes 4 years ago
poire-z 8a568a2721 bump crengine: add support for <ruby> elements
Includes:
- Fix some non-recursive subtree walkers
- Text: skip formatting optimisations when inlineBoxes
- CSS parsing: parse selectors starting with [attrib]
- Use T="" for internal elements attributes
- CSS: re-order css_d_* (display) enum for easier checking
- Rendering methods: remove erm_table_cell
- Rendering methods: remove erm_table_caption
- Rendering methods: remove erm_list_item
- getRenderedWidths(): better estimate table width
- styleToTextFmtFlags(): adds is_block parameter
- Adds support for "display: ruby" and <ruby> elements
- Fix prev/next-VisibleWord-Start/End() with CJK text

Also bump HarfBuzz to 2.6.8 and evernote-lua-sdk.
4 years ago
Galunid f09a4e7c8e
Translator: Add definition of the word to the translation (#6295)
closes #6293
4 years ago
yparitcher a9d4e97115
[plugin] Dispatcher: for profiles & gestures (#6106)
add a Dispatcher module that allows for dispatching multiple events at once.
This will allow for profiles & for gestures that do multiple things.

it has 2 methods:
Execute which is given a kv table of settings to change and fires an event for each of them.
addSubMenu adds a menu item to a menu to allow for modifying which events are called
it also has settingsList which is a master table of all allowed setting and their corresponding info
(it is mostly from ReaderGesture and needs a lot of work)

to allow for a new setting all one has to do is add a entry to settingsList with a corresponding event and it will work out of the box.

the profile plugin is right now still a stub, just to test Dispatcher. the plan is to finish it and eventually refactor ReaderGesture to rely on this.
This also needs effort to move many functions out of reader gesture into events where they belong.
4 years ago
Martín Fernández 88feefe788
[chore, UX] Move some 'permanent' settings inside more_tools (#6282)
Err, kind of nitpick PR. Is just add some "permanent" menus other than plugins to the new "more_tools" submenu. So it will never be empty.

Follow-up: #6279
Supersedes: #5512 #6092
Fixes: #5461
4 years ago
Martín Fernández 83cde64bcc
unified calibre plugin (#6177)
joins calibre metadata search and calibre wireless connections into a single plugin

search metadata changes:

- search directly into calibre metadata files.
- search can be performed on more than one library (configurable from a menu)
- device scans now find all calibre libraries under a given root
- search options can be configured from a menu. (case sensitive, find by title, author and path)
- removed legacy global variables.
- *option* to search from the reader
- *option* to generate a cache of books for faster searches.

calibre wireless connection changes:

- keep track of books in a library (includes prunning books from calibre metadata if the file was deleted locally)
- remove files on device from calibre
- support password protected connections
- FM integration: if we're in the inbox dir it will be updated each time a book is added or deleted.
- disconnect when requested by calibre, available on newer calibre versions (+4.17)
- remove unused opcodes.
- better report of client name, version and device id
- free disk space checks for all calibre versions
- bump supported extensions to match what KOReader can handle. Users can override this with their own list of extensions (or from calibre, by configuring the wireless device).
4 years ago
Martín Fernández 2e731dd4dd
[chore] Device abstraction (#6280)
* generic Device:info() function which returns the model

* add Device:canSuspend() and make it true in all devices that have suspend routines and the emulator

* also enable fake poweroff/reboot on the emulator

* add Device.home_dir

* add Device:hasExitOptions() and update menus & comments
4 years ago
Frans de Jonge f3489cdd24
[chore] Rename 'More plugins' to 'More tools' (#6279)
More tools is a submenu in the tools menu, not in the plugins menu. That everything in there happens to be plugins is merely a technical detail and not considered part of the unifying menu vision. Plugin management should be last as it is because it's only used once in a blue moon, if it should be in the tools menu at all. The same applies to settings more broadly. Putting plugin management in the tools menu is traditional, however.

Plugins should not and are not supposed to be most at home in the tools menu. Those plugins that happen to be in the tools menu are by and large there because that's where they fit best. Those that don't are new and I didn't have the heart or energy to make much of a fuzz about it provided they had a reasonable claim to the tools menu. That includes plugins like tweak document settings which should be more at home in settings → document.

Also see <https://github.com/koreader/koreader/issues/6105#issuecomment-621653800>.
4 years ago
poire-z 5aab341ed0
Fix bottom menu item titles truncation (#6273)
Revert bit from #6267 , see https://github.com/koreader/koreader/pull/6267#issuecomment-644903608.
4 years ago
Martín Fernández 765b35a7bf
android: add a toggle to ignore back button events (#6269)
Requires koreader/android-luajit-launcher#233
Requires koreader/koreader-base#1117

It is a workaround for #6263 but can be useful on some devices with erratic back key behaviour too (yep, Onyx)
4 years ago
NiLuJe b23af97914
Fix partial HW dithered refreshes sometimes appearing to shift refreshed content (#6267)
* Fix HW dithered partial refreshes sometimes behaving as if the refreshed
content had moved a few pixels to the side...

Probably a kernel issue with the alignment fixup in the EPDC?

* Get rid of the legacy coordinates fixup

It shouldn't be necessary anymore.
And I'd rather fix the root cause, anyway.

* Bump base

(https://github.com/koreader/koreader-base/pull/1116)

* Missed a few DIVs in #6224
4 years ago
NiLuJe 1f994f8ede
Floor dimension computations (mul/div). (#6264)
* floor most every dimension computations involving MUL or DIV
Should avoid passing nonsensical floating point coordinates/dimensions
to the UI code.

* Update base

* https://github.com/koreader/koreader-base/pull/1113
* https://github.com/koreader/koreader-base/pull/1114
* https://github.com/koreader/koreader-base/pull/1115

* Bump android-luajit-launcher

https://github.com/koreader/android-luajit-launcher/pull/230
https://github.com/koreader/android-luajit-launcher/pull/231
4 years ago
NiLuJe e3f978be2c
Allow automatically marking the book as read on end of doc (#6256)
Keep showing the "mark as" option/button, though, because that one is a
toggle, it doesn't enforce the "read" status.
4 years ago
smartscripts-nl 23ab5750c3
Fix missing glyphs Ï and Ö in keyboard popup (#6254)
Fixes #6221.
4 years ago
poire-z c1be488a11 Keyboard: better isolation of FR/ES/TR from EN base
dofile() wasn't enough to copy en_keyboard, as the references
to key popups would still be shared, and hacks to them (as
done by the FR keyboard) would be active on the EN keyboard.
Also, for the FR Keyboard:
- bring M key popup too when moving it to 2nd row.
- keep original ',' and '.' as on EN keyboard.
- add ';' instead of ',' as the added key, and let it have
  some key popup too, with keys helpful when CSS editing.
4 years ago
poire-z 886b3063e7
Style tweaks: adds "Book-specific tweak" menu item (#6244)
Allows editing a CSS snippet to be applied to this
book only, without the need to create and edit
a User style tweak.
Allows copying any other tweak CSS by just taping
on it (and pasting into this with Hold).
Limit User style tweaks nb of items per menu page
to 6 (like we try to do for other tweaks menus).
4 years ago
sladflob 9e9f3b419d
[feat] Allow message to be overlaid on other screensavers (#6238) 4 years ago
poire-z 3e71e4985e bump crengine: support for pseudo elements ::before/after
Includes:
- GIF decoding: avoid crash on some images
- Top progress bar: avoid re-computing when not needed
- Top progress bar: allow external filling of marks
- CSS/Text: properly inherit and handle text-align-last
- getRenderedWidths(): fix handling of text-indent
- Reorder some flags to make the sets clearer
- CSS: support more white-space named values
- Text: fix standalone BR not making an empty line (rework)
- CSS: support for pseudo elements ::before & ::after
- CSS: content: open-quote support via TextLangMan
- CSS/Text selection: adds a few "-cr-hint:" tweaks
cre.cpp: adds setHeaderProgressMarks()

Added 2 style tweaks to disable pseudo elements
::before/after and common ligatures.
4 years ago
Frans de Jonge 4a65cc666b
[UX] Implement hasFewKeys prototype (#6195)
This is a quick exploration into how the new Device:hasFewKeys() method could work to make things more usable on very limited devices.

In the reader, the right is repurposed to open the menu. Left in turn closes it.

The same principle is applied to ButtonDialog. This means you can select anything in principle, but once you go right you can't go back.

References <https://github.com/koreader/koreader/issues/4029>.
4 years ago
poire-z 03140f505c Wikipedia EPUBs: keep links in bold text bold 4 years ago
poire-z c65c33d75f
Statistics: some fixes, reordering and rewording (#6194)
- Fix wrong values for books opened (or first opened)
  from April 14th to May 20th: highlights and notes
  possibly being NULL was preventing nb of pages and
  last_open from being fetched.
- Re-order current book and all books stat items to some
  hopefully more sensible order.
- Some rewording for clarity.

KeyValuePage:
- Have value_overflow_align="right" only align right
  when value overflows 1/2 screen width, but not
  when only key overflows that.
- Show truncated text also on Tap when there is no
  callback.
4 years ago
poire-z 1e244d0358 [UX] Add fine tune for Word Spacing
Using DoubleSpinWidget.
Also keep SpinWidgets open on Apply.
Added little trick: if widget has been moved, close
bottom config menu on next Apply to show more of
the book.
4 years ago
poire-z e5206922c6 [UX] Normalize SpinWidget and DoubleSpinWidget
- Use same names for options;
- Have them both movable
- Add option to keep widget shown on Apply (and use that
  when appropriate: when the value may have an immediate
  visual effect, so one can tweak it without having to
  go thru menus to re-open it again).
4 years ago
poire-z d69a992e1d Font test sample: tweak footnote links
Make them external links so they don't trigger a "link is
invalid" popup and we can use swipe left/right to navigate
pages (and jump to latest bookmark/go back for comparing).
4 years ago
poire-z 8991540462
Reorganize bottom menu config panels (#6131)
Mostly for the PDF bottom menu.
- Reorganize by topic, trying to limit the number
  of widgets per panel to 4.
- Re-order some toggles from low to high ('off' then 'on').
- Show font size as number instead of a list of "Aa".
- PDF: add more font size values, and increase usable
  contrast values.
- Add help_text to most PDF toggle titles.
- CRE line spacing: increase fine tuning min and max.
Also avoid zoom advice messages on book load.
4 years ago
Martín Fdez 48727a984b android: add a toggle to force haptic feedback in spite of system settings 4 years ago
poire-z e074b603e0 Adds Word Expansion: use of letter spacing for justification
Bump crengine:
- Text: fix occasional BiDi bad word splitting
- Font: fix HB fallback measurement/drawing mismatches
- Font: do not add letter spacing on diacritics
- Text: tunable use of letter spacing for justification
- Text: dont adjust space after initial quotation mark/dash (rework)
- Text: fix possible bad widths after collapsed spaces

xtext.cpp: pick crengine fix with HB fallback
measurement/drawing mismatches

Adds "Word Expansion" to bottom Font size menu, and moved
"Word Spacing" there too, to balance the panels' heights
to 4 items.
4 years ago
poire-z 429f4bf1ae
Enable Highlight action on single word selection (#6114)
Also add "Dictionary" and "Fulltext search" to available
and cycleable highlight actions.
Generalize long-press (3s) at end of selection to show
the highlight dialog popup.
4 years ago
mwoz123 ce3bf473da
Add move to archive plugin (#6101) 4 years ago
poire-z 1a91893576
Allow toggling use of additional fallback fonts (#6095) 4 years ago
poire-z 6a98b2dce9
Text widgets, crengine: fix wrong vertical positioning (#6093)
Noticable with nastaliq arabic fonts.
bump crengine: fix wrong usage of Harfbuzz y_offset
Same in TextWidget and TextBoxWidget
4 years ago
Robert 72c9ec2aa0
Add support for physical button for page crop (#6091)
See: #2003
In page crop:
physical press button = OK
physical back button = Cancel
4 years ago
Frans de Jonge aa4bcd8c22
Screenshot: use month number instead of name (#6062)
Fixes #6055.
4 years ago
poire-z 6dc8bbcc49
Adds ReaderTypography (replaces ReaderHyphenation) (#6072)
Replace Hyphenation menu with Typography menu.
This works mostly like before:
- typography/hyphenation is chosen according to the book
  metadata language,
- one can set a default or a fallback language,
- hyphenation is now just a subset of typography, and
  can be disabled while still setting a language and
  enabling the other features,
- the typography language enables newly added features
  to crengine: per-language line breaking rules and
  per-language Harfbuzz glyph selection.
4 years ago
poire-z abdaf6e18c
Non-Touch: fix hang on bottom config menu navigation (#6047) 4 years ago
Martín Fdez 8e831eb756 desktop: disable battery on touch menu and reader footer
isDesktop and isEmulator are now different entities
4 years ago
poire-z 026140f809 Adds ReaderPageMap, to optionally show source pages numbers
bump crengine: support for EPUB3 nav toc and page maps
Includes:
- Fix lvRect:isRectInside(rc) with 0-width or 0-height rect
- TOC: parse EPUB3 nav toc, fallback to spine when no toc
- Parse and cache various hardcopy page list maps
- epub.css: hide EPUB3 <span epub:type="pagebreak"> content
cre.cpp: add a few PageMap helper functions.

Adds ReaderPageMap which will add a new menu (under TOC and
Bookmarks) that will allow:
- to list source page numbers (like a TOC)
- to show visible page labels in the right margin
- to use these source page numbers in the footer, the TOC,
  the GoTo and SkimTo widgets, and to use the source page
  number in the standard bookmark and highlight initial text.
4 years ago
poire-z 1cb3be324a TextBoxWidget: fix infinite loop when very small width 4 years ago
Sergey Avseyev 7a0fe89ab7
Add DJVU MIME type to OPDS browser (#5982) 4 years ago